summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/TypedArray/with-detached.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/TypedArray/with-detached.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/tests/non262/TypedArray/with-detached.js b/js/src/tests/non262/TypedArray/with-detached.js
new file mode 100644
index 0000000000..76711a0ee5
--- /dev/null
+++ b/js/src/tests/non262/TypedArray/with-detached.js
@@ -0,0 +1,10 @@
+// |reftest| shell-option(--enable-change-array-by-copy) skip-if(!Int32Array.prototype.with)
+
+var ta = new Int32Array([3, 2, 1]);
+
+detachArrayBuffer(ta.buffer);
+
+assertThrowsInstanceOf(() => ta.with(0, 0), TypeError);
+
+if (typeof reportCompare === "function")
+ reportCompare(0, 0);