summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/TypedArray/from_typedarray_fastpath_detached.js
blob: d1f574cb107cac2c1bb5191499bc4649381ac760 (plain)
1
2
3
4
5
6
7
8
9
10
// Ensure the fast-path when TypedArray.from is called with a TypedArray still
// checks for detached buffers.

var ta = new Int32Array(4);
detachArrayBuffer(ta.buffer);

assertThrowsInstanceOf(() => Int32Array.from(ta), TypeError);

if (typeof reportCompare === "function")
    reportCompare(true, true);