diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/TypedArray/set-detached-bigint.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/non262/TypedArray/set-detached-bigint.js b/js/src/tests/non262/TypedArray/set-detached-bigint.js new file mode 100644 index 0000000000..c54f4b867f --- /dev/null +++ b/js/src/tests/non262/TypedArray/set-detached-bigint.js @@ -0,0 +1,19 @@ +let ta = new BigInt64Array(10); + +let obj = { + get length() { + detachArrayBuffer(ta.buffer); + return 1; + }, + 0: { + valueOf() { + return "huzzah!"; + } + }, +}; + +// Throws a SyntaxError, because "huzzah!" can't be parsed as a BigInt. +assertThrowsInstanceOf(() => ta.set(obj), SyntaxError); + +if (typeof reportCompare === "function") + reportCompare(true, true); |