summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/TypedArray/constructor-non-detached.js
blob: 9ec9329be8aa3d7357ae697a64ba7fe2e050be5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);