diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/TypedArray/constructor-non-detached.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/tests/non262/TypedArray/constructor-non-detached.js b/js/src/tests/non262/TypedArray/constructor-non-detached.js new file mode 100644 index 0000000000..9ec9329be8 --- /dev/null +++ b/js/src/tests/non262/TypedArray/constructor-non-detached.js @@ -0,0 +1,13 @@ +for (var constructor of typedArrayConstructors) { + var buf = new constructor(); + detachArrayBuffer(buf.buffer); + assertThrowsInstanceOf(() => new constructor(buf), TypeError); + + var buffer = new ArrayBuffer(); + detachArrayBuffer(buffer); + assertThrowsInstanceOf(() => new constructor(buffer), TypeError); +} + + +if (typeof reportCompare === "function") + reportCompare(true, true); |