summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/TypedArray/toSorted-detached.js
blob: a4c5ba22525f155f8b8f4b9e022611c46aabaf93 (plain)
1
2
3
4
5
6
7
8
9
10
// |reftest| shell-option(--enable-change-array-by-copy) skip-if(!Int32Array.prototype.toSorted)

var ta = new Int32Array([3, 2, 1]);

detachArrayBuffer(ta.buffer);

assertThrowsInstanceOf(() => ta.toSorted(), TypeError);

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