diff --git a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/detached-buffer.js index e08e84c6c07..c31b2ec8820 100644 --- a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/detached-buffer.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, Symbol.toStringTag, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.sameValue(sample[Symbol.toStringTag], TA.name); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/return-typedarrayname.js b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/return-typedarrayname.js index 1cd8e47c902..13c80d44aa7 100644 --- a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/return-typedarrayname.js +++ b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/return-typedarrayname.js @@ -15,7 +15,7 @@ includes: [testTypedArray.js] features: [BigInt, Symbol.toStringTag, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var ta = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var ta = new TA(makeCtorArg(0)); assert.sameValue(ta[Symbol.toStringTag], TA.name, "property value"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js index f24e7147f11..7587e6fddad 100644 --- a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [Symbol.toStringTag, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.sameValue(sample[Symbol.toStringTag], TA.name); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js index b16a10837ad..2840761d9eb 100644 --- a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js +++ b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js @@ -15,7 +15,7 @@ includes: [testTypedArray.js] features: [Symbol.toStringTag, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var ta = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var ta = new TA(makeCtorArg(0)); assert.sameValue(ta[Symbol.toStringTag], TA.name, "property value"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js index deb168fb340..a134d722c58 100644 --- a/test/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js @@ -13,9 +13,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var buffer = new ArrayBuffer(8); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var buffer = makeCtorArg(8); var sample = new TA(buffer, 0, 1); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.buffer, buffer); -}, null, ["passthrough"]); +}, null, ["arraybuffer"], ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js b/test/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js index 037d36237c7..dccac55059c 100644 --- a/test/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js +++ b/test/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js @@ -14,9 +14,9 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var buffer = makeCtorArg(1); var ta = new TA(buffer); assert.sameValue(ta.buffer, buffer); -}, null, ["passthrough"]); +}, null, ["arraybuffer"]); diff --git a/test/built-ins/TypedArray/prototype/buffer/detached-buffer.js b/test/built-ins/TypedArray/prototype/buffer/detached-buffer.js index 1aa7e028c7c..e472bc3c8c5 100644 --- a/test/built-ins/TypedArray/prototype/buffer/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/buffer/detached-buffer.js @@ -13,9 +13,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var buffer = new ArrayBuffer(8); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var buffer = makeCtorArg(8); var sample = new TA(buffer, 0, 1); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.buffer, buffer); -}, null, ["passthrough"]); +}, null, ["arraybuffer"], ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/buffer/return-buffer.js b/test/built-ins/TypedArray/prototype/buffer/return-buffer.js index a80c1e072ea..c1a6f434020 100644 --- a/test/built-ins/TypedArray/prototype/buffer/return-buffer.js +++ b/test/built-ins/TypedArray/prototype/buffer/return-buffer.js @@ -14,9 +14,9 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var buffer = makeCtorArg(1); var ta = new TA(buffer); assert.sameValue(ta.buffer, buffer); -}, null, ["passthrough"]); +}, null, ["arraybuffer"]); diff --git a/test/built-ins/TypedArray/prototype/byteLength/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/byteLength/BigInt/detached-buffer.js index 08c330cb5f0..c1c9c9019da 100644 --- a/test/built-ins/TypedArray/prototype/byteLength/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/byteLength/BigInt/detached-buffer.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.byteLength, 0); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/byteLength/detached-buffer.js b/test/built-ins/TypedArray/prototype/byteLength/detached-buffer.js index 029ef7137e1..fdd57281e85 100644 --- a/test/built-ins/TypedArray/prototype/byteLength/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/byteLength/detached-buffer.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.byteLength, 0); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/byteOffset/BigInt/detached-buffer.js index 036c4cbbb50..aa7142867a6 100644 --- a/test/built-ins/TypedArray/prototype/byteOffset/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/byteOffset/BigInt/detached-buffer.js @@ -14,9 +14,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var buffer = new ArrayBuffer(128); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var buffer = makeCtorArg(128); var sample = new TA(buffer, 8, 1); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.byteOffset, 0); -}, null, ["passthrough"]); +}, null, ["arraybuffer"], ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/BigInt/return-byteoffset.js b/test/built-ins/TypedArray/prototype/byteOffset/BigInt/return-byteoffset.js index 2a53ba897a8..4e086d44ce4 100644 --- a/test/built-ins/TypedArray/prototype/byteOffset/BigInt/return-byteoffset.js +++ b/test/built-ins/TypedArray/prototype/byteOffset/BigInt/return-byteoffset.js @@ -14,18 +14,18 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var ta1 = new TA(); assert.sameValue(ta1.byteOffset, 0, "Regular typedArray"); var offset = 4 * TA.BYTES_PER_ELEMENT; - var buffer1 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT); + var buffer1 = makeCtorArg(8); var ta2 = new TA(buffer1, offset); assert.sameValue(ta2.byteOffset, offset, "TA(buffer, offset)"); - var buffer2 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT); + var buffer2 = makeCtorArg(8); var sample = new TA(buffer2, offset); var ta3 = new TA(sample); assert.sameValue(ta3.byteOffset, 0, "TA(typedArray)"); -}, null, ["passthrough"]); +}, null, ["arraybuffer"]); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/detached-buffer.js b/test/built-ins/TypedArray/prototype/byteOffset/detached-buffer.js index 0c1114403dc..6dbda3f738d 100644 --- a/test/built-ins/TypedArray/prototype/byteOffset/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/byteOffset/detached-buffer.js @@ -14,9 +14,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var buffer = new ArrayBuffer(128); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var buffer = makeCtorArg(128); var sample = new TA(buffer, 8, 1); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.byteOffset, 0); -}, null, ["passthrough"]); +}, null, ["arraybuffer"], ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js b/test/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js index 50f22d50fe2..cbca8c3ecb7 100644 --- a/test/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js +++ b/test/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js @@ -14,18 +14,18 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var ta1 = new TA(); assert.sameValue(ta1.byteOffset, 0, "Regular typedArray"); var offset = 4 * TA.BYTES_PER_ELEMENT; - var buffer1 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT); + var buffer1 = makeCtorArg(8); var ta2 = new TA(buffer1, offset); assert.sameValue(ta2.byteOffset, offset, "TA(buffer, offset)"); - var buffer2 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT); + var buffer2 = makeCtorArg(8); var sample = new TA(buffer2, offset); var ta3 = new TA(sample); assert.sameValue(ta3.byteOffset, 0, "TA(typedArray)"); -}, null, ["passthrough"]); +}, null, ["arraybuffer"]); diff --git a/test/built-ins/TypedArray/prototype/entries/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/entries/BigInt/detached-buffer.js index 381f1b7f8d2..7b965e58c32 100644 --- a/test/built-ins/TypedArray/prototype/entries/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/entries/BigInt/detached-buffer.js @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.entries(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/entries/detached-buffer.js b/test/built-ins/TypedArray/prototype/entries/detached-buffer.js index 87415a6eade..d5dfb77df6b 100644 --- a/test/built-ins/TypedArray/prototype/entries/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/entries/detached-buffer.js @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.entries(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/entries/return-itor.js b/test/built-ins/TypedArray/prototype/entries/return-itor.js index 217f3e37069..8a787626609 100644 --- a/test/built-ins/TypedArray/prototype/entries/return-itor.js +++ b/test/built-ins/TypedArray/prototype/entries/return-itor.js @@ -14,8 +14,8 @@ features: [TypedArray] var sample = [0, 42, 64]; -testWithTypedArrayConstructors(function(TA) { - var typedArray = new TA(sample); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var typedArray = new TA(makeCtorArg(sample)); var itor = typedArray.entries(); var next = itor.next(); @@ -33,4 +33,4 @@ testWithTypedArrayConstructors(function(TA) { next = itor.next(); assert.sameValue(next.value, undefined); assert.sameValue(next.done, true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-detachbuffer.js index 1b66fb608c7..ae6107ba435 100644 --- a/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-detachbuffer.js @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.every(function() { if (loops === 0) { @@ -38,4 +38,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-not-called-on-empty.js index ac79c980aab..5d49fa2eb33 100644 --- a/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-not-called-on-empty.js @@ -25,12 +25,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().every(function() { + new TA(makeCtorArg(0)).every(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/every/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/every/BigInt/detached-buffer.js index bb784071f31..1f4a4f7f55d 100644 --- a/test/built-ins/TypedArray/prototype/every/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/every/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.every(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/every/BigInt/returns-true-if-every-cb-returns-true.js b/test/built-ins/TypedArray/prototype/every/BigInt/returns-true-if-every-cb-returns-true.js index 9f3422fff36..6f364a3a2a7 100644 --- a/test/built-ins/TypedArray/prototype/every/BigInt/returns-true-if-every-cb-returns-true.js +++ b/test/built-ins/TypedArray/prototype/every/BigInt/returns-true-if-every-cb-returns-true.js @@ -20,7 +20,7 @@ includes: [testTypedArray.js] features: [BigInt, Symbol, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; var values = [ true, @@ -35,7 +35,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { 0.1, -0.1 ]; - var sample = new TA(values.length); + var sample = new TA(makeCtorArg(values.length)); var result = sample.every(function() { called++; return values.unshift(); @@ -43,4 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(called, sample.length, "callbackfn called for each index"); assert.sameValue(result, true, "return is true"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/every/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/every/callbackfn-detachbuffer.js index 3ca47cde6b9..5787fdc4a7f 100644 --- a/test/built-ins/TypedArray/prototype/every/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/every/callbackfn-detachbuffer.js @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.every(function() { if (loops === 0) { @@ -38,4 +38,4 @@ testWithTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/every/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/every/callbackfn-not-called-on-empty.js index 055c5065ca6..d347f6855f5 100644 --- a/test/built-ins/TypedArray/prototype/every/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/every/callbackfn-not-called-on-empty.js @@ -25,12 +25,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().every(function() { + new TA(makeCtorArg(0)).every(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/every/detached-buffer.js b/test/built-ins/TypedArray/prototype/every/detached-buffer.js index b5d535f691d..85910709e7e 100644 --- a/test/built-ins/TypedArray/prototype/every/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/every/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.every(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.js b/test/built-ins/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.js index f00d93d546b..52acdbae30b 100644 --- a/test/built-ins/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.js +++ b/test/built-ins/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.js @@ -20,7 +20,7 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; var values = [ true, @@ -35,7 +35,7 @@ testWithTypedArrayConstructors(function(TA) { 0.1, -0.1 ]; - var sample = new TA(values.length); + var sample = new TA(makeCtorArg(values.length)); var result = sample.every(function() { called++; return values.unshift(); @@ -43,4 +43,4 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(called, sample.length, "callbackfn called for each index"); assert.sameValue(result, true, "return is true"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-ctor.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-ctor.js index f26d2183136..5180ebdd047 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-ctor.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-ctor.js @@ -17,9 +17,9 @@ includes: [testTypedArray.js] features: [BigInt, Symbol.species, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var length = 42; - var sample = new TA(length); + var sample = new TA(makeCtorArg(length)); var calls = 0; var before = false; diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-species.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-species.js index 948af79ddba..785b334e6f5 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-species.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-called-before-species.js @@ -17,9 +17,9 @@ includes: [testTypedArray.js] features: [BigInt, Symbol.species, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var length = 42; - var sample = new TA(length); + var sample = new TA(makeCtorArg(length)); var calls = 0; var before = false; diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js index 04fb2e917cf..c66add78f54 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js @@ -18,9 +18,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.filter(function() { var flag = true; @@ -34,4 +34,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-not-called-on-empty.js index 2b8effd4189..3e98c6da687 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-not-called-on-empty.js @@ -16,12 +16,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().filter(function() { + new TA(makeCtorArg(0)).filter(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/filter/BigInt/detached-buffer.js index 808fec19215..d0d7ec883b3 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.filter(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-ctor.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-ctor.js index ec67bea1bd4..765a6730c38 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-ctor.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-ctor.js @@ -17,9 +17,9 @@ includes: [testTypedArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var length = 42; - var sample = new TA(length); + var sample = new TA(makeCtorArg(length)); var calls = 0; var before = false; diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-species.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-species.js index a5e77a49139..4289ab5dfc2 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-species.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-called-before-species.js @@ -17,9 +17,9 @@ includes: [testTypedArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var length = 42; - var sample = new TA(length); + var sample = new TA(makeCtorArg(length)); var calls = 0; var before = false; diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-detachbuffer.js index 638438e219d..2f3e1ed1a64 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-detachbuffer.js @@ -17,9 +17,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.filter(function() { if (loops === 0) { @@ -30,4 +30,4 @@ testWithTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-not-called-on-empty.js index 8adf0021807..0d7f6183765 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-not-called-on-empty.js @@ -16,12 +16,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().filter(function() { + new TA(makeCtorArg(0)).filter(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/filter/detached-buffer.js b/test/built-ins/TypedArray/prototype/filter/detached-buffer.js index 5f25343417c..84a498de00e 100644 --- a/test/built-ins/TypedArray/prototype/filter/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/filter/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.filter(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-destination-backed-by-immutable-buffer.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-destination-backed-by-immutable-buffer.js new file mode 100644 index 00000000000..ac1a61b1088 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-destination-backed-by-immutable-buffer.js @@ -0,0 +1,82 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.prototype.filter +description: > + Throws a TypeError exception when the receiver constructs an instance backed + by an immutable buffer +info: | + %TypedArray%.prototype.filter ( callback [ , thisArg ] ) + ... + 8. Repeat, while k < len, + a. Let Pk be ! ToString(𝔽(k)). + b. Let kValue be ! Get(O, Pk). + c. Let selected be ToBoolean(? Call(callback, thisArg, « kValue, 𝔽(k), O »)). + d. If selected is true, then + i. Append kValue to kept. + ii. Set captured to captured + 1. + e. Set k to k + 1. + 9. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(captured) », ~write~). + 10. Assert: IsImmutableBuffer(A.[[ViewedArrayBuffer]]) is false. + + TypedArraySpeciesCreate ( exemplar, argumentList [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to ~read~. + 2. Let defaultConstructor be the intrinsic object associated with the constructor name exemplar.[[TypedArrayName]] in Table 73. + 3. Let constructor be ? SpeciesConstructor(exemplar, defaultConstructor). + 4. Let result be ? TypedArrayCreateFromConstructor(constructor, argumentList, accessMode). + + TypedArrayCreateFromConstructor ( constructor, argumentList [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to ~read~. + 2. Let newTypedArray be ? Construct(constructor, argumentList). + 3. Let taRecord be ? ValidateTypedArray(newTypedArray, seq-cst, accessMode). + + ValidateTypedArray ( O, order [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to read. + 2. Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + 3. Assert: O has a [[ViewedArrayBuffer]] internal slot. + 4. If accessMode is ~write~ and IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. +features: [Symbol.species, TypedArray, immutable-arraybuffer] +includes: [testTypedArray.js, compareArray.js] +---*/ + +testWithAllTypedArrayConstructors((TA, makeCtorArg) => { + var calls = []; + + var ta = new TA(makeCtorArg(["1", "2"])); + var iab = (new TA(["3", "4"])).buffer.transferToImmutable(); + var constructor = {}; + Object.defineProperty(ta, "constructor", { + get: function() { + calls.push("get ta.constructor"); + return constructor; + } + }); + Object.defineProperty(constructor, Symbol.species, { + get: function() { + calls.push("get ta.constructor[Symbol.species]"); + return function speciesCtor() { + calls.push("construct result"); + var result = new TA(iab); + calls.push("return result"); + return result; + }; + } + }); + + assert.throws(TypeError, function() { + ta.filter(function(value, index) { + calls.push("filter index " + index); + return !index; + }); + }); + var expectCalls = [ + "filter index 0", + "filter index 1", + "get ta.constructor", + "get ta.constructor[Symbol.species]", + "construct result", + "return result" + ]; + assert.compareArray(calls, expectCalls, "Must visit elements before constructing the result."); +}); diff --git a/test/built-ins/TypedArray/prototype/find/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/find/BigInt/detached-buffer.js index da8daa539db..f271038edca 100644 --- a/test/built-ins/TypedArray/prototype/find/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/find/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.find(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/find/BigInt/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/find/BigInt/predicate-is-not-callable-throws.js index e33cc3646dd..cdff56f3a6e 100644 --- a/test/built-ins/TypedArray/prototype/find/BigInt/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/find/BigInt/predicate-is-not-callable-throws.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.find({}); @@ -63,4 +63,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.find(/./); }, "regexp"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/find/BigInt/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/find/BigInt/predicate-may-detach-buffer.js index 65720dc5e21..6bdec4d6259 100644 --- a/test/built-ins/TypedArray/prototype/find/BigInt/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/find/BigInt/predicate-may-detach-buffer.js @@ -42,9 +42,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.find(function() { if (loops === 0) { @@ -54,4 +54,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/find/BigInt/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/find/BigInt/predicate-not-called-on-empty-array.js index 152d92f52fb..69fa9f1e5bc 100644 --- a/test/built-ins/TypedArray/prototype/find/BigInt/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/find/BigInt/predicate-not-called-on-empty-array.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var result = sample.find(function() { @@ -46,4 +46,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { undefined, "find returns undefined when predicate is not called" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/find/detached-buffer.js b/test/built-ins/TypedArray/prototype/find/detached-buffer.js index c37bd6962f7..e2152642ccb 100644 --- a/test/built-ins/TypedArray/prototype/find/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/find/detached-buffer.js @@ -23,10 +23,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.find(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/find/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/find/predicate-is-not-callable-throws.js index d041ec58791..72c5ec5f3c4 100644 --- a/test/built-ins/TypedArray/prototype/find/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/find/predicate-is-not-callable-throws.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.find({}); @@ -63,4 +63,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.find(/./); }, "regexp"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/find/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/find/predicate-may-detach-buffer.js index 80a70f9dad5..56fa10b2689 100644 --- a/test/built-ins/TypedArray/prototype/find/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/find/predicate-may-detach-buffer.js @@ -42,9 +42,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.find(function() { if (loops === 0) { @@ -54,4 +54,4 @@ testWithTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/find/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/find/predicate-not-called-on-empty-array.js index 9dd1e94ab02..efcec713124 100644 --- a/test/built-ins/TypedArray/prototype/find/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/find/predicate-not-called-on-empty-array.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var result = sample.find(function() { @@ -46,4 +46,4 @@ testWithTypedArrayConstructors(function(TA) { undefined, "find returns undefined when predicate is not called" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/detached-buffer.js index a3fbcbd99c2..7b5e2ad6c64 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.findIndex(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-is-not-callable-throws.js index c7fd1178996..18c281d5c5c 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-is-not-callable-throws.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.findIndex({}); }, "{}"); @@ -60,5 +60,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.findIndex(/./); }, "/./"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js index 831bccbf988..6cbedff1c43 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js @@ -34,8 +34,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(2); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(2)); var loops = 0; sample.findIndex(function() { @@ -45,4 +45,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { loops++; }); assert.sameValue(loops, 2, "predicate is called once"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-not-called-on-empty-array.js index e60ad6ae102..cd9fb709909 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-not-called-on-empty-array.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var predicate = function() { @@ -45,4 +45,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { result, -1, "returns -1 on an empty instance" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findIndex/detached-buffer.js b/test/built-ins/TypedArray/prototype/findIndex/detached-buffer.js index 5d79ae9af8b..8ff3a6ef9ca 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/findIndex/detached-buffer.js @@ -23,10 +23,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.findIndex(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.js index 07e07caf7b1..c859acc7f18 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.findIndex({}); }, "{}"); @@ -60,5 +60,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.findIndex(/./); }, "/./"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/findIndex/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/findIndex/predicate-may-detach-buffer.js index fca55d59895..54ac0d615f5 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/findIndex/predicate-may-detach-buffer.js @@ -31,8 +31,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(2); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(2)); var loops = 0; sample.findIndex(function() { @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA) { loops++; }); assert.sameValue(loops, 2, "predicate is called once"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.js index 7a3ec2a004e..41ff0abda79 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var predicate = function() { @@ -45,4 +45,4 @@ testWithTypedArrayConstructors(function(TA) { result, -1, "returns -1 on an empty instance" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findLast/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/findLast/BigInt/detached-buffer.js index ce76155d122..bedeb671387 100644 --- a/test/built-ins/TypedArray/prototype/findLast/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLast/BigInt/detached-buffer.js @@ -21,10 +21,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.findLast(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-is-not-callable-throws.js index 9d4251a9be7..082fb04ec38 100644 --- a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-is-not-callable-throws.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray, array-find-from-last] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.findLast({}); @@ -52,4 +52,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.findLast(/./); }, "regexp"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-may-detach-buffer.js index 6cd3e204a61..1927ed16677 100644 --- a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-may-detach-buffer.js @@ -24,9 +24,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray, array-find-from-last] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.findLast(function() { if (loops === 0) { @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-not-called-on-empty-array.js index 0ac503c7136..672810e69e5 100644 --- a/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/findLast/BigInt/predicate-not-called-on-empty-array.js @@ -15,8 +15,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray, array-find-from-last] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var result = sample.findLast(function() { @@ -34,4 +34,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { undefined, "findLast returns undefined when predicate is not called" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findLast/detached-buffer.js b/test/built-ins/TypedArray/prototype/findLast/detached-buffer.js index fa0f8b6af81..1667c253865 100644 --- a/test/built-ins/TypedArray/prototype/findLast/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLast/detached-buffer.js @@ -21,10 +21,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.findLast(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js index abfa53835f5..958cb4b92d5 100644 --- a/test/built-ins/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js] features: [TypedArray, array-find-from-last] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.findLast({}); @@ -52,4 +52,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.findLast(/./); }, "regexp"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findLast/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/findLast/predicate-may-detach-buffer.js index 45f2f837142..60222805b9a 100644 --- a/test/built-ins/TypedArray/prototype/findLast/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLast/predicate-may-detach-buffer.js @@ -24,9 +24,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray, array-find-from-last] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.findLast(function() { if (loops === 0) { @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js index 9d804b4c348..2b6ba1014ee 100644 --- a/test/built-ins/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js @@ -15,8 +15,8 @@ includes: [testTypedArray.js] features: [TypedArray, array-find-from-last] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var result = sample.findLast(function() { @@ -34,4 +34,4 @@ testWithTypedArrayConstructors(function(TA) { undefined, "findLast returns undefined when predicate is not called" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/detached-buffer.js index 75684bc023e..877cd49d2d8 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.findLastIndex(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-is-not-callable-throws.js index ef0a4f17012..1ad6d0ca0aa 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-is-not-callable-throws.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray, array-find-from-last] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.findLastIndex({}); }, "{}"); @@ -51,5 +51,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.findLastIndex(/./); }, "/./"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-may-detach-buffer.js index 252923f21c8..fa51f7444fc 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-may-detach-buffer.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray, array-find-from-last] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(2); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(2)); var loops = 0; sample.findLastIndex(function() { @@ -34,4 +34,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { loops++; }); assert.sameValue(loops, 2, "predicate is called once"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-not-called-on-empty-array.js index 774c57eb08e..41b2a43cf3b 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/BigInt/predicate-not-called-on-empty-array.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray, array-find-from-last] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var predicate = function() { @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { result, -1, "returns -1 on an empty instance" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/detached-buffer.js b/test/built-ins/TypedArray/prototype/findLastIndex/detached-buffer.js index f2e9c00f1bd..955dc1a7018 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/detached-buffer.js @@ -23,10 +23,10 @@ var predicate = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.findLastIndex(predicate); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js index ec7ecacf88a..745c26995ba 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js] features: [TypedArray, array-find-from-last] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.findLastIndex({}); }, "{}"); @@ -51,5 +51,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.findLastIndex(/./); }, "/./"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js index 147f64162e1..15745d2267a 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray, array-find-from-last] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(2); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(2)); var loops = 0; sample.findLastIndex(function() { @@ -34,4 +34,4 @@ testWithTypedArrayConstructors(function(TA) { loops++; }); assert.sameValue(loops, 2, "predicate is called once"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js index 18d6c80db1b..95fe9e2b826 100644 --- a/test/built-ins/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js +++ b/test/built-ins/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js] features: [TypedArray, array-find-from-last] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); var called = false; var predicate = function() { @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA) { result, -1, "returns -1 on an empty instance" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/forEach/BigInt/arraylength-internal.js b/test/built-ins/TypedArray/prototype/forEach/BigInt/arraylength-internal.js index fbe8544d5f3..0ae4f2e59c3 100644 --- a/test/built-ins/TypedArray/prototype/forEach/BigInt/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/forEach/BigInt/arraylength-internal.js @@ -43,5 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }); assert.sameValue(loop, 7, "accessor descriptor"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-detachbuffer.js index cfb457f8072..7bb15321753 100644 --- a/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-detachbuffer.js @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.forEach(function() { if (loops === 0) { @@ -37,4 +37,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-not-called-on-empty.js index 72e719d82a2..a96dff276bb 100644 --- a/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-not-called-on-empty.js @@ -25,12 +25,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().forEach(function() { + new TA(makeCtorArg(0)).forEach(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/forEach/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/forEach/BigInt/detached-buffer.js index b8acbcc4b28..d9b4220e1b9 100644 --- a/test/built-ins/TypedArray/prototype/forEach/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/forEach/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.forEach(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/forEach/arraylength-internal.js b/test/built-ins/TypedArray/prototype/forEach/arraylength-internal.js index ba7e08bf46b..7cfe7f77c59 100644 --- a/test/built-ins/TypedArray/prototype/forEach/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/forEach/arraylength-internal.js @@ -43,5 +43,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }); assert.sameValue(loop, 7, "accessor descriptor"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.js index d2a8a31d7ea..62228118ff7 100644 --- a/test/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.js @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.forEach(function() { if (loops === 0) { @@ -37,4 +37,4 @@ testWithTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.js index c039fff8dd4..14aca8e7883 100644 --- a/test/built-ins/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.js @@ -25,12 +25,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().forEach(function() { + new TA(makeCtorArg(0)).forEach(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/forEach/detached-buffer.js b/test/built-ins/TypedArray/prototype/forEach/detached-buffer.js index 9415d549606..16d85c5bb29 100644 --- a/test/built-ins/TypedArray/prototype/forEach/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/forEach/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.forEach(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-false-for-zero.js b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-false-for-zero.js index c45405bf86d..d24a2079e4e 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-false-for-zero.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-false-for-zero.js @@ -33,8 +33,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -43,4 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.includes(0n, fromIndex), false); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-true-for-undefined.js b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-true-for-undefined.js index 9b79efad06b..ad6a163369b 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-true-for-undefined.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer-during-fromIndex-returns-true-for-undefined.js @@ -3,7 +3,7 @@ /*--- esid: sec-%typedarray%.prototype.includes description: > - Returns false if buffer is detached after ValidateTypedArray and searchElement is a value + Returns true if buffer is detached after ValidateTypedArray and searchElement is undefined info: | %TypedArray%.prototype.includes ( searchElement [ , fromIndex ] ) @@ -34,8 +34,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -44,4 +44,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.includes(undefined, fromIndex), true); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js index 8944bbed0a0..4cbfc9a57c0 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.includes(0n); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js b/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js index af723ed08f8..f424bdc3fde 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/length-zero-returns-false.js @@ -28,12 +28,12 @@ var fromIndex = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.includes(0), false, "returns false"); assert.sameValue(sample.includes(), false, "returns false - no arg"); assert.sameValue( sample.includes(0n, fromIndex), false, "length is checked before ToInteger(fromIndex)" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js b/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js index c8cac5d0dde..2463120ecd1 100644 --- a/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js +++ b/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js @@ -3,7 +3,7 @@ /*--- esid: sec-%typedarray%.prototype.includes description: > - Returns false if buffer is detached after ValidateTypedArray and searchElement is a value + Returns false if buffer is detached after ValidateTypedArray and searchElement is not undefined info: | %TypedArray%.prototype.includes ( searchElement [ , fromIndex ] ) @@ -34,8 +34,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.includes(0, fromIndex), false); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js b/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js index de8a5f95249..0d3d7f6f29c 100644 --- a/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js +++ b/test/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js @@ -34,8 +34,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.includes(undefined, fromIndex), true); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/includes/detached-buffer.js b/test/built-ins/TypedArray/prototype/includes/detached-buffer.js index 864871778c7..1b1ea4750e3 100644 --- a/test/built-ins/TypedArray/prototype/includes/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/includes/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.includes(0); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/includes/length-zero-returns-false.js b/test/built-ins/TypedArray/prototype/includes/length-zero-returns-false.js index 0bafd9f9f2a..45c22ad6fe0 100644 --- a/test/built-ins/TypedArray/prototype/includes/length-zero-returns-false.js +++ b/test/built-ins/TypedArray/prototype/includes/length-zero-returns-false.js @@ -28,12 +28,12 @@ var fromIndex = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.includes(0), false, "returns false"); assert.sameValue(sample.includes(), false, "returns false - no arg"); assert.sameValue( sample.includes(0, fromIndex), false, "length is checked before ToInteger(fromIndex)" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js index bb1774ee0bd..6553066e636 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-%typedarray%.prototype.indexof -description: Throws a TypeError if this has a detached buffer +description: Returns -1 if buffer is detached after ValidateTypedArray info: | %TypedArray%.prototype.indexOf ( searchElement [ , fromIndex ] ) @@ -36,8 +36,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -46,4 +46,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.indexOf(undefined, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js index 1b877af2548..31cbc6c8fb2 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-%typedarray%.prototype.indexof -description: Throws a TypeError if this has a detached buffer +description: Returns -1 if buffer is detached after ValidateTypedArray info: | %TypedArray%.prototype.indexOf ( searchElement [ , fromIndex ] ) @@ -36,8 +36,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -46,4 +46,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.indexOf(0n, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js index acc7a76616a..7a9ec72f591 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.indexOf(0n); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js index b43eaff9a32..9c439b1bc8b 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/length-zero-returns-minus-one.js @@ -27,11 +27,11 @@ var fromIndex = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.indexOf(0n), -1, "returns -1"); assert.sameValue( sample.indexOf(0n, fromIndex), -1, "length is checked before ToInteger(fromIndex)" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js b/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js index c05fc647ad2..504bc19ed8e 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js +++ b/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -46,4 +46,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.indexOf(undefined, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js b/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js index fd044fbd3f5..741d44b90d0 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js +++ b/test/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -46,4 +46,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.indexOf(0, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/indexOf/detached-buffer.js b/test/built-ins/TypedArray/prototype/indexOf/detached-buffer.js index 573ddc0c800..1e01b6c5fd7 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/indexOf/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.indexOf(0); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/indexOf/length-zero-returns-minus-one.js b/test/built-ins/TypedArray/prototype/indexOf/length-zero-returns-minus-one.js index 53a8c4fca40..b207ed95daf 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/length-zero-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/indexOf/length-zero-returns-minus-one.js @@ -27,11 +27,11 @@ var fromIndex = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.indexOf(0), -1, "returns -1"); assert.sameValue( sample.indexOf(0, fromIndex), -1, "length is checked before ToInteger(fromIndex)" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer-during-fromIndex-returns-single-comma.js b/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer-during-fromIndex-returns-single-comma.js index a84d1452159..78107d27bda 100644 --- a/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer-during-fromIndex-returns-single-comma.js +++ b/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer-during-fromIndex-returns-single-comma.js @@ -29,8 +29,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - const sample = new TA([1n,2n,3n]); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg([1n,2n,3n])); const separator = { toString() { $DETACHBUFFER(sample.buffer); @@ -39,4 +39,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.join(separator), ',,'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer.js index c5b584c31eb..2e74fd5b995 100644 --- a/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/join/BigInt/detached-buffer.js @@ -24,10 +24,10 @@ let obj = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - let sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + let sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, () => { sample.join(obj); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/join/BigInt/empty-instance-empty-string.js b/test/built-ins/TypedArray/prototype/join/BigInt/empty-instance-empty-string.js index c0638c4de87..c709334d6f4 100644 --- a/test/built-ins/TypedArray/prototype/join/BigInt/empty-instance-empty-string.js +++ b/test/built-ins/TypedArray/prototype/join/BigInt/empty-instance-empty-string.js @@ -21,9 +21,9 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.join(), ""); assert.sameValue(sample.join("test262"), ""); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator-symbol.js b/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator-symbol.js index 0bfcc1b17a9..f3cc194015a 100644 --- a/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator-symbol.js +++ b/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator-symbol.js @@ -23,10 +23,10 @@ features: [BigInt, Symbol, TypedArray] var s = Symbol(""); -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.join(s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator.js b/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator.js index 7ea61bd4dea..640e7a377bd 100644 --- a/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator.js +++ b/test/built-ins/TypedArray/prototype/join/BigInt/return-abrupt-from-separator.js @@ -27,10 +27,10 @@ var obj = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.join(obj); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js b/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js index d89d65b5c60..3fe58668433 100644 --- a/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js +++ b/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js @@ -31,8 +31,8 @@ features: [TypedArray] var arr = [-2, Infinity, NaN, -Infinity, 0.6, 9007199254740992]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); var result, separator, expected; separator = ","; @@ -132,4 +132,4 @@ testWithTypedArrayConstructors(function(TA) { }).join(separator); result = sample.join(separator); assert.sameValue(result, expected, "using: " + separator); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js b/test/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js index c44a154e086..a9a329a677a 100644 --- a/test/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js +++ b/test/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js @@ -29,8 +29,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - const sample = new TA([1,2,3]); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg([1,2,3])); const separator = { toString() { $DETACHBUFFER(sample.buffer); @@ -39,4 +39,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.join(separator), ',,'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/join/detached-buffer.js b/test/built-ins/TypedArray/prototype/join/detached-buffer.js index 104b20cd409..c741b8fb85e 100644 --- a/test/built-ins/TypedArray/prototype/join/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/join/detached-buffer.js @@ -24,10 +24,10 @@ let obj = { } }; -testWithTypedArrayConstructors(function(TA) { - let sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + let sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, () => { sample.join(obj); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js b/test/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js index 5bee678817f..3b3902132cb 100644 --- a/test/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js +++ b/test/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js @@ -21,9 +21,9 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.join(), ""); assert.sameValue(sample.join("test262"), ""); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js b/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js index 14096788156..a517201d917 100644 --- a/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js +++ b/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js @@ -30,8 +30,8 @@ features: [TypedArray] var arr = [-2, Infinity, NaN, -Infinity, 0.6, 9007199254740992]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); // Use converted values using Array methods as helpers var expected = arr.map(function(_, i) { @@ -41,4 +41,4 @@ testWithTypedArrayConstructors(function(TA) { var result = sample.join(); assert.sameValue(result, expected); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js b/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js index a1df649ca0e..6e930d5b1f7 100644 --- a/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js +++ b/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js @@ -23,10 +23,10 @@ features: [Symbol, TypedArray] var s = Symbol(""); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.join(s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js b/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js index 0a64c53808a..ddb5bf3834e 100644 --- a/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js +++ b/test/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js @@ -27,10 +27,10 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.join(obj); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/keys/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/keys/BigInt/detached-buffer.js index 425f729620c..9e0a2d9b056 100644 --- a/test/built-ins/TypedArray/prototype/keys/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/keys/BigInt/detached-buffer.js @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.keys(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js b/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js index e1d9db19333..47698c1f2e9 100644 --- a/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js +++ b/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js @@ -14,8 +14,8 @@ features: [BigInt, TypedArray] var sample = [0n, 42n, 64n]; -testWithBigIntTypedArrayConstructors(function(TA) { - var typedArray = new TA(sample); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var typedArray = new TA(makeCtorArg(sample)); var itor = typedArray.keys(); var next = itor.next(); @@ -33,4 +33,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { next = itor.next(); assert.sameValue(next.value, undefined); assert.sameValue(next.done, true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/keys/detached-buffer.js b/test/built-ins/TypedArray/prototype/keys/detached-buffer.js index 8c097b7ee1f..72f53aa34bd 100644 --- a/test/built-ins/TypedArray/prototype/keys/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/keys/detached-buffer.js @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.keys(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/keys/return-itor.js b/test/built-ins/TypedArray/prototype/keys/return-itor.js index 4ea2460883e..a8802462923 100644 --- a/test/built-ins/TypedArray/prototype/keys/return-itor.js +++ b/test/built-ins/TypedArray/prototype/keys/return-itor.js @@ -14,8 +14,8 @@ features: [TypedArray] var sample = [0, 42, 64]; -testWithTypedArrayConstructors(function(TA) { - var typedArray = new TA(sample); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var typedArray = new TA(makeCtorArg(sample)); var itor = typedArray.keys(); var next = itor.next(); @@ -33,4 +33,4 @@ testWithTypedArrayConstructors(function(TA) { next = itor.next(); assert.sameValue(next.value, undefined); assert.sameValue(next.done, true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js index 807821f023f..7ed8dbf32c3 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js @@ -33,8 +33,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -43,4 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.lastIndexOf(undefined, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js index f4ccfd28643..d47563cdb33 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js @@ -33,8 +33,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -43,4 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.lastIndexOf(0n, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js index 58c8f2c69e5..ef74306fc12 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.lastIndexOf(0n); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js index f8ba1991546..3500cc11009 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/length-zero-returns-minus-one.js @@ -27,11 +27,11 @@ var fromIndex = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.lastIndexOf(0), -1, "returns -1"); assert.sameValue( sample.lastIndexOf(0n, fromIndex), -1, "length is checked before ToInteger(fromIndex)" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js b/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js index c49ada378e1..6172c23bbe5 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js @@ -33,8 +33,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -43,4 +43,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.lastIndexOf(undefined, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js b/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js index 120e9b818da..9273b21fad6 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js @@ -33,8 +33,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - const sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + const sample = new TA(makeCtorArg(1)); const fromIndex = { valueOf() { $DETACHBUFFER(sample.buffer); @@ -43,4 +43,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(sample.lastIndexOf(0, fromIndex), -1); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer.js b/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer.js index 717f32e8b23..c959b9258f6 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.lastIndexOf(0); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.js b/test/built-ins/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.js index 6481759acc7..574258158ef 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.js @@ -27,11 +27,11 @@ var fromIndex = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.lastIndexOf(0), -1, "returns -1"); assert.sameValue( sample.lastIndexOf(0, fromIndex), -1, "length is checked before ToInteger(fromIndex)" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/length/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/length/BigInt/detached-buffer.js index 2a0a155fab4..e752b6f033e 100644 --- a/test/built-ins/TypedArray/prototype/length/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/length/BigInt/detached-buffer.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(42); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(42)); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.length, 0); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/length/detached-buffer.js b/test/built-ins/TypedArray/prototype/length/detached-buffer.js index 9762092255c..232cfe9ab3c 100644 --- a/test/built-ins/TypedArray/prototype/length/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/length/detached-buffer.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(42); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(42)); $DETACHBUFFER(sample.buffer); assert.sameValue(sample.length, 0); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js b/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js index 6c5a599736b..897a22fe713 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js @@ -41,5 +41,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { return 0n; }); assert.sameValue(loop, 4, "accessor descriptor"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js index ded0928ab35..d0953693101 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js @@ -17,9 +17,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.map(function() { if (loops === 0) { @@ -30,4 +30,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-not-called-on-empty.js index 8f63f39c28c..fb67cf404c1 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-not-called-on-empty.js @@ -17,12 +17,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().map(function() { + new TA(makeCtorArg(0)).map(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/map/BigInt/detached-buffer.js index 76d39d558f5..b6626c658cb 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.map(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor-abrupt.js index dbe9cb5cf08..8e2eb553b99 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor-abrupt.js @@ -42,4 +42,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }); }); assert.sameValue(callCount, 0, "callback should not be called"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor.js index f419827c62d..fb7983ed0da 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-ctor.js @@ -51,4 +51,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { TA, "use defaultCtor on an undefined return - .constructor check" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species-abrupt.js b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species-abrupt.js index 2fb535f0d3f..3d7a09c209e 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species-abrupt.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species-abrupt.js @@ -42,4 +42,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.map(function() { return 0n; }); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species.js b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species.js index ad722cec7f6..894a3b4eb2f 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/speciesctor-get-species.js @@ -43,4 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { sample.map(function() { return 0n; }); assert.sameValue(calls, 1); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/arraylength-internal.js b/test/built-ins/TypedArray/prototype/map/arraylength-internal.js index 5c4430109d9..9afaaf8bb22 100644 --- a/test/built-ins/TypedArray/prototype/map/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/map/arraylength-internal.js @@ -41,5 +41,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { return 0; }); assert.sameValue(loop, 4, "accessor descriptor"); -}, null, ["passthrough"]); - +}); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js index a2bc8971892..1c6d829acaa 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js @@ -17,9 +17,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.map(function() { if (loops === 0) { @@ -30,4 +30,4 @@ testWithTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/map/callbackfn-not-called-on-empty.js index 49949decf90..624d15fd5d8 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-not-called-on-empty.js @@ -17,12 +17,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().map(function() { + new TA(makeCtorArg(0)).map(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/detached-buffer.js b/test/built-ins/TypedArray/prototype/map/detached-buffer.js index cc00481646d..9dd098b4771 100644 --- a/test/built-ins/TypedArray/prototype/map/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/map/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.map(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/map/speciesctor-destination-backed-by-immutable-buffer.js b/test/built-ins/TypedArray/prototype/map/speciesctor-destination-backed-by-immutable-buffer.js new file mode 100644 index 00000000000..78a791367e7 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/map/speciesctor-destination-backed-by-immutable-buffer.js @@ -0,0 +1,75 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.prototype.map +description: > + Throws a TypeError exception when the receiver constructs an instance backed + by an immutable buffer +info: | + %TypedArray%.prototype.map ( callback [ , thisArg ] ) + 1. Let O be the this value. + 2. Let taRecord be ? ValidateTypedArray(O, seq-cst). + 3. Let len be TypedArrayLength(taRecord). + 4. If IsCallable(callback) is false, throw a TypeError exception. + 5. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(len) », ~write~). + 6. Assert: IsImmutableBuffer(A.[[ViewedArrayBuffer]]) is false. + + TypedArraySpeciesCreate ( exemplar, argumentList [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to ~read~. + 2. Let defaultConstructor be the intrinsic object associated with the constructor name exemplar.[[TypedArrayName]] in Table 73. + 3. Let constructor be ? SpeciesConstructor(exemplar, defaultConstructor). + 4. Let result be ? TypedArrayCreateFromConstructor(constructor, argumentList, accessMode). + + TypedArrayCreateFromConstructor ( constructor, argumentList [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to ~read~. + 2. Let newTypedArray be ? Construct(constructor, argumentList). + 3. Let taRecord be ? ValidateTypedArray(newTypedArray, seq-cst, accessMode). + + ValidateTypedArray ( O, order [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to read. + 2. Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + 3. Assert: O has a [[ViewedArrayBuffer]] internal slot. + 4. If accessMode is ~write~ and IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. +features: [Symbol.species, TypedArray, immutable-arraybuffer] +includes: [testTypedArray.js, compareArray.js] +---*/ + +testWithAllTypedArrayConstructors((TA, makeCtorArg) => { + var calls = []; + + var ta = new TA(makeCtorArg(["1", "2"])); + var iab = (new TA(["3", "4"])).buffer.transferToImmutable(); + var constructor = {}; + Object.defineProperty(ta, "constructor", { + get: function() { + calls.push("get ta.constructor"); + return constructor; + } + }); + Object.defineProperty(constructor, Symbol.species, { + get: function() { + calls.push("get ta.constructor[Symbol.species]"); + return function speciesCtor() { + calls.push("construct result"); + var result = new TA(iab); + calls.push("return result"); + return result; + }; + } + }); + + assert.throws(TypeError, function() { + ta.map(function(value, index) { + calls.push("map index " + index); + return value + value; + }); + }); + var expectCalls = [ + "get ta.constructor", + "get ta.constructor[Symbol.species]", + "construct result", + "return result" + ]; + assert.compareArray(calls, expectCalls, "Must construct the result before visiting elements."); +}); diff --git a/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js index af57566325d..1785c6e1b1c 100644 --- a/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }); }); assert.sameValue(callCount, 0, "callback should not be called"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor.js index 7baee96aff3..ea9ba0f7a71 100644 --- a/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/map/speciesctor-get-ctor.js @@ -51,4 +51,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { TA, "use defaultCtor on an undefined return - .constructor check" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/speciesctor-get-species-abrupt.js b/test/built-ins/TypedArray/prototype/map/speciesctor-get-species-abrupt.js index 0bb552550be..1c03830ef42 100644 --- a/test/built-ins/TypedArray/prototype/map/speciesctor-get-species-abrupt.js +++ b/test/built-ins/TypedArray/prototype/map/speciesctor-get-species-abrupt.js @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.map(function() { return 0; }); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/map/speciesctor-get-species.js b/test/built-ins/TypedArray/prototype/map/speciesctor-get-species.js index b0f67c5750b..8d06df752fe 100644 --- a/test/built-ins/TypedArray/prototype/map/speciesctor-get-species.js +++ b/test/built-ins/TypedArray/prototype/map/speciesctor-get-species.js @@ -43,4 +43,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { sample.map(function() {}); assert.sameValue(calls, 1); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-detachbuffer.js index a525adf06fb..e44cff48d15 100644 --- a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-detachbuffer.js @@ -26,9 +26,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.reduce(function() { if (loops === 0) { @@ -39,4 +39,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }, 0); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-not-called-on-empty.js index d06bacd67dc..4e46e868f30 100644 --- a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-not-called-on-empty.js @@ -28,12 +28,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().reduce(function() { + new TA(makeCtorArg(0)).reduce(function() { called++; }, undefined); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/detached-buffer.js index 5efbe4a86d8..3381e3187e0 100644 --- a/test/built-ins/TypedArray/prototype/reduce/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.reduce(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-return-initialvalue.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-return-initialvalue.js index 97d68c27080..e4647e07716 100644 --- a/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-return-initialvalue.js +++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-return-initialvalue.js @@ -30,12 +30,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = false; - var result = new TA().reduce(function() { + var result = new TA(makeCtorArg(0)).reduce(function() { called = true; }, 42); assert.sameValue(result, 42); assert.sameValue(called, false); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-with-no-initialvalue-throws.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-with-no-initialvalue-throws.js index 17a37f79259..1e6dcf12efe 100644 --- a/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-with-no-initialvalue-throws.js +++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/empty-instance-with-no-initialvalue-throws.js @@ -21,14 +21,15 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; + var ta = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { - new TA().reduce(function() { + ta.reduce(function() { called++; }); }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduce/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/reduce/callbackfn-detachbuffer.js index dfc80fff398..483f512857e 100644 --- a/test/built-ins/TypedArray/prototype/reduce/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/reduce/callbackfn-detachbuffer.js @@ -26,9 +26,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.reduce(function() { if (loops === 0) { @@ -39,4 +39,4 @@ testWithTypedArrayConstructors(function(TA) { }, 0); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.js index 988ca67d0e4..290ece99c74 100644 --- a/test/built-ins/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.js @@ -28,12 +28,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().reduce(function() { + new TA(makeCtorArg(0)).reduce(function() { called++; }, undefined); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduce/detached-buffer.js b/test/built-ins/TypedArray/prototype/reduce/detached-buffer.js index 133253fa1fb..18617d2b01a 100644 --- a/test/built-ins/TypedArray/prototype/reduce/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/reduce/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.reduce(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduce/empty-instance-return-initialvalue.js b/test/built-ins/TypedArray/prototype/reduce/empty-instance-return-initialvalue.js index b8c6dba5b4c..8a2e697bfac 100644 --- a/test/built-ins/TypedArray/prototype/reduce/empty-instance-return-initialvalue.js +++ b/test/built-ins/TypedArray/prototype/reduce/empty-instance-return-initialvalue.js @@ -30,12 +30,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = false; - var result = new TA().reduce(function() { + var result = new TA(makeCtorArg(0)).reduce(function() { called = true; }, 42); assert.sameValue(result, 42); assert.sameValue(called, false); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.js b/test/built-ins/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.js index fd902fd1f08..1181bbedc98 100644 --- a/test/built-ins/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.js +++ b/test/built-ins/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.js @@ -21,14 +21,15 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; + var ta = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { - new TA().reduce(function() { + ta.reduce(function() { called++; }); }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-detachbuffer.js index d25ffa51d0f..ed395786eeb 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-detachbuffer.js @@ -26,9 +26,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.reduceRight(function() { if (loops === 0) { @@ -39,4 +39,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }, 0); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-not-called-on-empty.js index 3dec96ab450..ca4049f618d 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-not-called-on-empty.js @@ -29,12 +29,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().reduceRight(function() { + new TA(makeCtorArg(0)).reduceRight(function() { called++; }, undefined); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/detached-buffer.js index 3bad2c54ed6..f519ea122cc 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.reduceRight(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-return-initialvalue.js b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-return-initialvalue.js index 7a066ea9303..7380c6b09e2 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-return-initialvalue.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-return-initialvalue.js @@ -31,12 +31,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = false; - var result = new TA().reduceRight(function() { + var result = new TA(makeCtorArg(0)).reduceRight(function() { called = true; }, 42); assert.sameValue(result, 42); assert.sameValue(called, false); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-with-no-initialvalue-throws.js b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-with-no-initialvalue-throws.js index 51d93596386..d5ff1b3d156 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-with-no-initialvalue-throws.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/empty-instance-with-no-initialvalue-throws.js @@ -21,14 +21,15 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; + var ta = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { - new TA().reduceRight(function() { + ta.reduceRight(function() { called++; }); }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.js index c6f517c5ec9..eae63b762b6 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.js @@ -26,9 +26,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.reduceRight(function() { if (loops === 0) { @@ -39,4 +39,4 @@ testWithTypedArrayConstructors(function(TA) { }, 0); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.js index ce7443ce2b5..3efc294cabc 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.js @@ -29,12 +29,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().reduceRight(function() { + new TA(makeCtorArg(0)).reduceRight(function() { called++; }, undefined); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/detached-buffer.js b/test/built-ins/TypedArray/prototype/reduceRight/detached-buffer.js index 1270aed0678..320972a2b85 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/detached-buffer.js @@ -29,4 +29,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { sample.reduceRight(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.js b/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.js index 512b3f77ef9..b39670290d7 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.js @@ -31,12 +31,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = false; - var result = new TA().reduceRight(function() { + var result = new TA(makeCtorArg(0)).reduceRight(function() { called = true; }, 42); assert.sameValue(result, 42); assert.sameValue(called, false); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.js b/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.js index e0b9a72c3c1..7d387c6c561 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.js @@ -21,14 +21,15 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; + var ta = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { - new TA().reduceRight(function() { + ta.reduceRight(function() { called++; }); }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js index e282d415917..2e84ed5f648 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js @@ -31,15 +31,15 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - var sample = new TA(1); + var sample = new TA(makeCtorArg(1)); sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array; - counter++; $DETACHBUFFER(sample.buffer); + counter++; return new other(count); }; @@ -49,4 +49,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js index 02ef04db075..4c9a80c9110 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js @@ -31,15 +31,15 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - let sample = new TA(1); + let sample = new TA(makeCtorArg(1)); sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { - counter++; $DETACHBUFFER(sample.buffer); - return new TA(count); + counter++; + return new TA(makeCtorArg(count)); }; assert.throws(TypeError, function() { @@ -48,4 +48,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js index 44e0f109af3..f52a353d27f 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js @@ -31,14 +31,14 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - let sample = new TA(1); + let sample = new TA(makeCtorArg(1)); Object.defineProperty(sample, "constructor", { get() { - counter++; $DETACHBUFFER(sample.buffer); + counter++; } }); assert.throws(TypeError, function() { @@ -47,4 +47,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js index 11e70b69d45..d06b74346b0 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js @@ -30,15 +30,15 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - let sample = new TA(1); + let sample = new TA(makeCtorArg(1)); sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { let other = new TA(count); - counter++; $DETACHBUFFER(other.buffer); + counter++; return other; }; @@ -48,4 +48,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js index d2000c97e2b..4c9b184e899 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js @@ -17,19 +17,19 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; let sample, result, Other, other; let ctor = {}; ctor[Symbol.species] = function(count) { - counter++; Other = TA === BigInt64Array ? BigUint64Array : BigInt64Array; $DETACHBUFFER(sample.buffer); + counter++; other = new Other(count); return other; }; - sample = new TA(0); + sample = new TA(makeCtorArg(0)); sample.constructor = ctor; result = sample.slice(); assert.sameValue(result.length, 0, 'The value of result.length is 0'); @@ -38,8 +38,8 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(result, other, 'The value of `result` is expected to equal the value of other'); assert.sameValue(counter, 1, 'The value of `counter` is 1'); - sample = new TA(4); + sample = new TA(makeCtorArg(4)); sample.constructor = ctor; sample.slice(1, 1); // count = 0; assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js index 28b42831038..e81f3203080 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js @@ -16,18 +16,18 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; let sample, result, other; let ctor = {}; ctor[Symbol.species] = function(count) { - counter++; $DETACHBUFFER(sample.buffer); - other = new TA(count); + counter++; + other = new TA(makeCtorArg(count)); return other; }; - sample = new TA(0); + sample = new TA(makeCtorArg(0)); sample.constructor = ctor; result = sample.slice(); assert.sameValue(result.length, 0, 'The value of result.length is 0'); @@ -35,7 +35,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(result, other, 'The value of `result` is expected to equal the value of other'); assert.sameValue(counter, 1, 'The value of `counter` is 1'); - sample = new TA(4); + sample = new TA(makeCtorArg(4)); sample.constructor = ctor; result = sample.slice(1, 1); // count = 0; assert.sameValue(result.length, 0, 'The value of result.length is 0'); @@ -46,4 +46,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { ); assert.sameValue(result.constructor, TA, 'The value of result.constructor is expected to equal the value of TA'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer.js index 6a1505a6832..d27e10bf15e 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer.js @@ -24,10 +24,10 @@ var obj = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.slice(obj, obj); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end-symbol.js b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end-symbol.js index 4ededf13d94..5fa95cde553 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end-symbol.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end-symbol.js @@ -16,10 +16,10 @@ features: [BigInt, Symbol, TypedArray] var s = Symbol("1"); -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.slice(0, s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end.js b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end.js index 92b322d45e2..ac95ebfde0b 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-end.js @@ -26,8 +26,8 @@ var o2 = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.slice(0, o1); @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.slice(0, o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start-symbol.js b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start-symbol.js index 39aeda0c7c4..9294630901d 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start-symbol.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start-symbol.js @@ -15,10 +15,10 @@ features: [BigInt, Symbol, TypedArray] var s = Symbol("1"); -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.slice(s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start.js b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start.js index 031693a8310..34f9cff342b 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/return-abrupt-from-start.js @@ -25,8 +25,8 @@ var o2 = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.slice(o1); @@ -35,4 +35,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.slice(o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js b/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js index 59a8f98fbb3..03617c64a27 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js @@ -32,8 +32,8 @@ features: [BigInt, Symbol.species, TypedArray] var arr = [42n, 43n, 44n]; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array; sample.constructor = {}; @@ -44,4 +44,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert(compareArray(result, arr), "values are set"); assert.notSameValue(result.buffer, sample.buffer, "creates a new buffer"); assert.sameValue(result.constructor, other, "used the custom ctor"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-abrupt.js index 7ff0f281b38..14f0026f174 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-abrupt.js @@ -38,4 +38,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.slice(); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor.js index ff4c3a55700..13c3a3ba4ff 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor.js @@ -51,4 +51,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { TA, "use defaultCtor on an undefined return - .constructor check" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-abrupt.js b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-abrupt.js index 615e9c93174..da0fda3ee20 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-abrupt.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-abrupt.js @@ -42,4 +42,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.slice(); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species.js b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species.js index 199fb6d2752..0e708d56968 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species.js @@ -43,4 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { sample.slice(); assert.sameValue(calls, 1); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js index 55d3d3af75d..b8348bb1f1f 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js @@ -17,15 +17,15 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - var sample = new TA(1); + var sample = new TA(makeCtorArg(1)); sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { var other = TA === Int8Array ? Int16Array : Int8Array; - counter++; $DETACHBUFFER(sample.buffer); + counter++; return new other(count); }; @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js index 83eb3abd95a..67457b2c87b 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js @@ -15,15 +15,15 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - let sample = new TA(1); + let sample = new TA(makeCtorArg(1)); sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { - counter++; $DETACHBUFFER(sample.buffer); - return new TA(count); + counter++; + return new TA(makeCtorArg(count)); }; assert.throws(TypeError, function() { @@ -32,4 +32,4 @@ testWithTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-get-ctor.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-get-ctor.js index 2b37e081384..131f01410ac 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-get-ctor.js @@ -15,14 +15,14 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - let sample = new TA(1); + let sample = new TA(makeCtorArg(1)); Object.defineProperty(sample, "constructor", { get() { - counter++; $DETACHBUFFER(sample.buffer); + counter++; } }); assert.throws(TypeError, function() { @@ -31,4 +31,4 @@ testWithTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js index d8abf5034b1..60349317faa 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js @@ -30,15 +30,15 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; - let sample = new TA(1); + let sample = new TA(makeCtorArg(1)); sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { let other = new TA(count); - counter++; $DETACHBUFFER(other.buffer); + counter++; return other; }; @@ -48,4 +48,4 @@ testWithTypedArrayConstructors(function(TA) { }, '`sample.slice()` throws TypeError'); assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js index 1b778ec473e..23f7e612a95 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js @@ -17,19 +17,19 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; let sample, result, Other, other; let ctor = {}; ctor[Symbol.species] = function(count) { - counter++; Other = TA === Int16Array ? Int8Array : Int16Array; $DETACHBUFFER(sample.buffer); + counter++; other = new Other(count); return other; }; - sample = new TA(0); + sample = new TA(makeCtorArg(0)); sample.constructor = ctor; result = sample.slice(); assert.sameValue(result.length, 0, 'The value of result.length is 0'); @@ -38,8 +38,8 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(result, other, 'The value of `result` is expected to equal the value of other'); assert.sameValue(counter, 1, 'The value of `counter` is 1'); - sample = new TA(4); + sample = new TA(makeCtorArg(4)); sample.constructor = ctor; sample.slice(1, 1); // count = 0; assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js index f996487df9f..5fd7ff35cda 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js @@ -16,18 +16,18 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { let counter = 0; let sample, result, other; let ctor = {}; ctor[Symbol.species] = function(count) { - counter++; $DETACHBUFFER(sample.buffer); - other = new TA(count); + counter++; + other = new TA(makeCtorArg(count)); return other; }; - sample = new TA(0); + sample = new TA(makeCtorArg(0)); sample.constructor = ctor; result = sample.slice(); assert.sameValue(result.length, 0, 'The value of result.length is 0'); @@ -35,8 +35,8 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(result, other, 'The value of `result` is expected to equal the value of other'); assert.sameValue(counter, 1, 'The value of `counter` is 1'); - sample = new TA(4); + sample = new TA(makeCtorArg(4)); sample.constructor = ctor; sample.slice(1, 1); // count = 0; assert.sameValue(counter, 2, 'The value of `counter` is 2'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer.js index bbbb576f36d..d319836b2b9 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer.js @@ -24,10 +24,10 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.slice(obj, obj); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end-symbol.js b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end-symbol.js index 7c3fe8f7716..8245a0c195e 100644 --- a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end-symbol.js +++ b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end-symbol.js @@ -16,10 +16,10 @@ features: [Symbol, TypedArray] var s = Symbol("1"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.slice(0, s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end.js b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end.js index 58c6a54739f..941ef6f38d3 100644 --- a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end.js +++ b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-end.js @@ -26,8 +26,8 @@ var o2 = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.slice(0, o1); @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.slice(0, o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start-symbol.js b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start-symbol.js index 0dbf1fee6dc..a88f1101a9d 100644 --- a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start-symbol.js +++ b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start-symbol.js @@ -15,10 +15,10 @@ features: [Symbol, TypedArray] var s = Symbol("1"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.slice(s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start.js b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start.js index 57c78ef133b..170164f5fc0 100644 --- a/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start.js +++ b/test/built-ins/TypedArray/prototype/slice/return-abrupt-from-start.js @@ -25,8 +25,8 @@ var o2 = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.slice(o1); @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.slice(o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js b/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js index e160e456345..be479b5924f 100644 --- a/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js +++ b/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js @@ -32,8 +32,8 @@ features: [Symbol.species, TypedArray] var arr = [42, 43, 44]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); var other = TA === Int8Array ? Uint8Array : Int8Array; sample.constructor = {}; @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA) { assert(compareArray(result, arr), "values are set"); assert.notSameValue(result.buffer, sample.buffer, "creates a new buffer"); assert.sameValue(result.constructor, other, "used the custom ctor"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-destination-backed-by-immutable-buffer.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-destination-backed-by-immutable-buffer.js new file mode 100644 index 00000000000..de34ca54be1 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-destination-backed-by-immutable-buffer.js @@ -0,0 +1,95 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.prototype.slice +description: > + Throws a TypeError exception when the receiver constructs an instance backed + by an immutable buffer +info: | + %TypedArray%.prototype.slice ( start, end ) + 1. Let O be the this value. + 2. Let taRecord be ? ValidateTypedArray(O, seq-cst). + 3. Let srcArrayLength be TypedArrayLength(taRecord). + 4. Let relativeStart be ? ToIntegerOrInfinity(start). + 5. If relativeStart = -∞, let startIndex be 0. + 6. Else if relativeStart < 0, let startIndex be max(srcArrayLength + relativeStart, 0). + 7. Else, let startIndex be min(relativeStart, srcArrayLength). + 8. If end is undefined, let relativeEnd be srcArrayLength; else let relativeEnd be ? ToIntegerOrInfinity(end). + 9. If relativeEnd = -∞, let endIndex be 0. + 10. Else if relativeEnd < 0, let endIndex be max(srcArrayLength + relativeEnd, 0). + 11. Else, let endIndex be min(relativeEnd, srcArrayLength). + 12. Let countBytes be max(endIndex - startIndex, 0). + 13. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(countBytes) », ~write~). + 14. Assert: IsImmutableBuffer(A.[[ViewedArrayBuffer]]) is false. + + TypedArraySpeciesCreate ( exemplar, argumentList [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to ~read~. + 2. Let defaultConstructor be the intrinsic object associated with the constructor name exemplar.[[TypedArrayName]] in Table 73. + 3. Let constructor be ? SpeciesConstructor(exemplar, defaultConstructor). + 4. Let result be ? TypedArrayCreateFromConstructor(constructor, argumentList, accessMode). + + TypedArrayCreateFromConstructor ( constructor, argumentList [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to ~read~. + 2. Let newTypedArray be ? Construct(constructor, argumentList). + 3. Let taRecord be ? ValidateTypedArray(newTypedArray, seq-cst, accessMode). + + ValidateTypedArray ( O, order [ , accessMode ] ) + 1. If accessMode is not present, set accessMode to read. + 2. Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + 3. Assert: O has a [[ViewedArrayBuffer]] internal slot. + 4. If accessMode is ~write~ and IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. +features: [Symbol.species, TypedArray, immutable-arraybuffer] +includes: [testTypedArray.js, compareArray.js] +---*/ + +testWithAllTypedArrayConstructors((TA, makeCtorArg) => { + var calls = []; + + var ta = new TA(makeCtorArg(["1", "2"])); + var iab = (new TA(["3", "4"])).buffer.transferToImmutable(); + var constructor = {}; + Object.defineProperty(ta, "constructor", { + get: function() { + calls.push("get ta.constructor"); + return constructor; + } + }); + Object.defineProperty(constructor, Symbol.species, { + get: function() { + calls.push("get ta.constructor[Symbol.species]"); + return function speciesCtor() { + calls.push("construct result"); + var result = new TA(iab); + calls.push("return result"); + return result; + }; + } + }); + + var start = { + valueOf() { + calls.push("start.valueOf"); + return 0; + } + }; + var end = { + valueOf() { + calls.push("end.valueOf"); + return 2; + } + }; + + assert.throws(TypeError, function() { + ta.slice(start, end); + }); + var expectCalls = [ + "start.valueOf", + "end.valueOf", + "get ta.constructor", + "get ta.constructor[Symbol.species]", + "construct result", + "return result" + ]; + assert.compareArray(calls, expectCalls, "Must read arguments before constructing the result."); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js index 66c57ef889a..600bfd1c756 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js @@ -38,4 +38,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.slice(); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js index bdfd46e0141..5eada61fb2b 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js @@ -51,4 +51,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { TA, "use defaultCtor on an undefined return - .constructor check" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-abrupt.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-abrupt.js index fe47fea383c..8ec6ab7cd01 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-abrupt.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-abrupt.js @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.slice(); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species.js index bf6e20432e3..14ed6903ca7 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species.js @@ -43,4 +43,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { sample.slice(); assert.sameValue(calls, 1); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-return-same-buffer-with-offset.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-return-same-buffer-with-offset.js index 46cc8085eea..d7770d1fb4b 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-return-same-buffer-with-offset.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-return-same-buffer-with-offset.js @@ -17,19 +17,19 @@ info: | 1. Let value be GetValueFromBuffer(srcBuffer, srcByteIndex, uint8, true, unordered). 2. Perform SetValueInBuffer(targetBuffer, targetByteIndex, uint8, value, true, unordered). ... -features: [TypedArray] +features: [Symbol.species, TypedArray] includes: [testTypedArray.js, compareArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { - var ta = new TA([ +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var ta = new TA(makeCtorArg([ 10, 20, 30, 40, 50, 60, - ]); + ])); ta.constructor = { [Symbol.species]: function() { @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA) { assert.compareArray(result, [ 20, 20, 20, 60, ]); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-detachbuffer.js index 9aef470ec7c..38c7b6b95d7 100644 --- a/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-detachbuffer.js @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.some(function() { if (loops === 0) { @@ -38,4 +38,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-not-called-on-empty.js index d05c270e47f..8afc7dfb5cc 100644 --- a/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-not-called-on-empty.js @@ -25,12 +25,12 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().some(function() { + new TA(makeCtorArg(0)).some(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/some/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/some/BigInt/detached-buffer.js index b7b84a16549..5be15e2dbd5 100644 --- a/test/built-ins/TypedArray/prototype/some/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/some/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.some(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/some/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/some/callbackfn-detachbuffer.js index 35e1a91eacc..74f63c1b18f 100644 --- a/test/built-ins/TypedArray/prototype/some/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/some/callbackfn-detachbuffer.js @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var loops = 0; - var sample = new TA(2); + var sample = new TA(makeCtorArg(2)); sample.some(function() { if (loops === 0) { @@ -38,4 +38,4 @@ testWithTypedArrayConstructors(function(TA) { }); assert.sameValue(loops, 2); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/some/callbackfn-not-called-on-empty.js b/test/built-ins/TypedArray/prototype/some/callbackfn-not-called-on-empty.js index f90690b4e0a..bdf59806f9e 100644 --- a/test/built-ins/TypedArray/prototype/some/callbackfn-not-called-on-empty.js +++ b/test/built-ins/TypedArray/prototype/some/callbackfn-not-called-on-empty.js @@ -25,12 +25,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { var called = 0; - new TA().some(function() { + new TA(makeCtorArg(0)).some(function() { called++; }); assert.sameValue(called, 0); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/some/detached-buffer.js b/test/built-ins/TypedArray/prototype/some/detached-buffer.js index 1ad6a7078b2..ef3d335c914 100644 --- a/test/built-ins/TypedArray/prototype/some/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/some/detached-buffer.js @@ -23,10 +23,10 @@ var callbackfn = function() { throw new Test262Error(); }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.some(callbackfn); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/detached-buffer.js index 8cfe424305a..6b577b84025 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/detached-buffer.js @@ -50,8 +50,8 @@ var o2 = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(2); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(2)); begin = false; end = false; @@ -62,4 +62,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert(begin, "observable ToInteger(begin)"); assert(end, "observable ToInteger(end)"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin-symbol.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin-symbol.js index 3b1b36cefd0..573ca62d9e3 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin-symbol.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin-symbol.js @@ -15,10 +15,10 @@ features: [BigInt, Symbol, TypedArray] var s = Symbol("1"); -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.subarray(s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin.js index 2388d053998..cea9a0d3e7d 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-begin.js @@ -25,8 +25,8 @@ var o2 = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.subarray(o1); @@ -35,4 +35,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.subarray(o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end-symbol.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end-symbol.js index 44b1dec715e..6bdfb8b9bd9 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end-symbol.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end-symbol.js @@ -16,10 +16,10 @@ features: [BigInt, Symbol, TypedArray] var s = Symbol("1"); -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.subarray(0, s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end.js index 8b892bc903a..0171394a88b 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/return-abrupt-from-end.js @@ -26,8 +26,8 @@ var o2 = { } }; -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.subarray(0, o1); @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.subarray(0, o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-abrupt.js index 48c7dbd2b89..8fe2989d8a2 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-abrupt.js @@ -37,4 +37,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.subarray(0); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor.js index 4e257fc557a..6e64824a3fa 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor.js @@ -50,4 +50,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { TA, "use defaultCtor on an undefined return - .constructor check" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-abrupt.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-abrupt.js index cf6b59386b9..2ce5e3fce40 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-abrupt.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-abrupt.js @@ -41,4 +41,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.subarray(0); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species.js b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species.js index dcf74af431a..d38aacfcd5f 100644 --- a/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species.js +++ b/test/built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species.js @@ -42,4 +42,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { sample.subarray(0); assert.sameValue(calls, 1); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/byteoffset-with-detached-buffer.js b/test/built-ins/TypedArray/prototype/subarray/byteoffset-with-detached-buffer.js index 590e3c59580..e036c6c301c 100644 --- a/test/built-ins/TypedArray/prototype/subarray/byteoffset-with-detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/subarray/byteoffset-with-detached-buffer.js @@ -16,12 +16,12 @@ info: | ... f. Let argumentsList be « buffer, 𝔽(beginByteOffset), 𝔽(newLength) ». 17. Return ? TypedArraySpeciesCreate(O, argumentsList). -features: [TypedArray] +features: [Symbol.species, TypedArray] includes: [testTypedArray.js, detachArrayBuffer.js] ---*/ -testWithTypedArrayConstructors(function(TA) { - var ab = new ArrayBuffer(2 * TA.BYTES_PER_ELEMENT); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var ab = makeCtorArg(2 * TA.BYTES_PER_ELEMENT); var ta = new TA(ab, TA.BYTES_PER_ELEMENT, 1); var result = new TA(0); @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA) { }; assert.sameValue(ta.subarray(1, end), result); -}, null, ["passthrough"]); +}, null, ["arraybuffer"], ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/subarray/detached-buffer.js b/test/built-ins/TypedArray/prototype/subarray/detached-buffer.js index fb049c89074..97b03e0f313 100644 --- a/test/built-ins/TypedArray/prototype/subarray/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/subarray/detached-buffer.js @@ -50,8 +50,8 @@ var o2 = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(2); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(2)); begin = false; end = false; @@ -62,4 +62,4 @@ testWithTypedArrayConstructors(function(TA) { assert(begin, "observable ToInteger(begin)"); assert(end, "observable ToInteger(end)"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.js b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.js index 8d9fd089066..1e54741d328 100644 --- a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.js +++ b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.js @@ -15,10 +15,10 @@ features: [Symbol, TypedArray] var s = Symbol("1"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.subarray(s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin.js b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin.js index e021609dcdd..c62f5c15070 100644 --- a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin.js +++ b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin.js @@ -25,8 +25,8 @@ var o2 = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.subarray(o1); @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.subarray(o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.js b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.js index a780599ffab..aebf96477b5 100644 --- a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.js +++ b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.js @@ -16,10 +16,10 @@ features: [Symbol, TypedArray] var s = Symbol("1"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(TypeError, function() { sample.subarray(0, s); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end.js b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end.js index 56a9ea4675d..f3dee021525 100644 --- a/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end.js +++ b/test/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end.js @@ -26,8 +26,8 @@ var o2 = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.throws(Test262Error, function() { sample.subarray(0, o1); @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.subarray(0, o2); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js index 419a33780fe..577d346fa3c 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js @@ -37,4 +37,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.subarray(0); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js index 3ef0b4e75a6..5dce4cc439d 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js @@ -50,4 +50,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { TA, "use defaultCtor on an undefined return - .constructor check" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.js index b6bcce9ae7a..ed7519dcd89 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.js @@ -41,4 +41,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.subarray(0); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species.js index 63bcecbcf72..a54d9798693 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species.js @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { sample.subarray(0); assert.sameValue(calls, 1); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js index d481f520323..23063d0dd7f 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js @@ -50,9 +50,9 @@ BigInt.prototype.toLocaleString = function() { var arr = [42n, 0n]; var expected = ["hacks1", "hacks2"].join(separator); -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = 0; assert.sameValue(sample.toLocaleString(), expected, "returns expected value"); assert.sameValue(calls, 2, "toString called once for each item"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/detached-buffer.js index 75ed4c77f74..9fc4ec7348f 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.toLocaleString(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/empty-instance-returns-empty-string.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/empty-instance-returns-empty-string.js index 26dd219a08a..32eb1cbaf5e 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/empty-instance-returns-empty-string.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/empty-instance-returns-empty-string.js @@ -20,7 +20,7 @@ includes: [testTypedArray.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.toLocaleString(), ""); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js index 1457e3a2245..d1221082784 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js @@ -42,12 +42,12 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; var expected = ["hacks1", "hacks2"].join(separator); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = []; assert.sameValue(sample.toLocaleString(), expected, "returns expected value"); assert( compareArray(new TA(calls), sample), "toLocaleString called for each item" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js index c82a5c8c070..308e001a3b5 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js @@ -50,9 +50,9 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; var expected = ["hacks1", "hacks2"].join(separator); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = 0; assert.sameValue(sample.toLocaleString(), expected, "returns expected value"); assert.sameValue(calls, 2, "toString called once for each item"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js index 85d37be0602..1edd27e689c 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js @@ -48,9 +48,9 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; var expected = ["hacks1", "hacks2"].join(separator); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = 0; assert.sameValue(sample.toLocaleString(), expected, "returns expected value"); assert.sameValue(calls, 2, "valueOf called once for each item"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/detached-buffer.js b/test/built-ins/TypedArray/prototype/toLocaleString/detached-buffer.js index 52740d73293..29dedb54299 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/detached-buffer.js @@ -19,10 +19,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.toLocaleString(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.js b/test/built-ins/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.js index 1f64581d794..3fa6bb94b0f 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.js @@ -20,7 +20,7 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(0)); assert.sameValue(sample.toLocaleString(), ""); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js index 290ec32f472..dbc488b32a3 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js @@ -33,11 +33,11 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { calls = 0; - var sample = new TA(arr); + var sample = new TA(makeCtorArg(arr)); assert.throws(Test262Error, function() { sample.toLocaleString(); }); assert.sameValue(calls, 1, "abrupt from first element"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js index 46d352aefa3..cb922d25002 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js @@ -45,11 +45,11 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); }); assert.sameValue(calls, 1, "toString called once"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js index 9e830ae9e39..eb291e38e9f 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js @@ -46,11 +46,11 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); }); assert.sameValue(calls, 1, "toString called once"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js index d82a9c3da9f..ef4e1611b05 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js @@ -36,11 +36,11 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { calls = 0; - var sample = new TA(arr); + var sample = new TA(makeCtorArg(arr)); assert.throws(Test262Error, function() { sample.toLocaleString(); }); assert.sameValue(calls, 2, "abrupt from a next element"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js index c6dd6a43866..afef5ba97dd 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js @@ -47,11 +47,11 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); }); assert.sameValue(calls, 2, "abrupt from a nextElement"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js index 3b9697ebaac..5f64a3ab9b0 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js @@ -48,11 +48,11 @@ Number.prototype.toLocaleString = function() { var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); }); assert.sameValue(calls, 2, "abrupt from a nextElement"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js index a35a693d0f6..7a96f46dc94 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js @@ -35,8 +35,8 @@ var separator = ["", ""].toLocaleString(); var arr = [42, 0, 43]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(arr)); var expected = sample[0].toLocaleString().toString() + separator + @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA) { separator + sample[2].toLocaleString().toString(); assert.sameValue(sample.toLocaleString(), expected); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toReversed/ignores-species.js b/test/built-ins/TypedArray/prototype/toReversed/ignores-species.js index 80172fe2e8e..9a7cfdca2a9 100644 --- a/test/built-ins/TypedArray/prototype/toReversed/ignores-species.js +++ b/test/built-ins/TypedArray/prototype/toReversed/ignores-species.js @@ -17,25 +17,25 @@ info: | 2. Let constructor be the intrinsic object listed in column one of Table 63 for exemplar.[[TypedArrayName]]. ... includes: [testTypedArray.js] -features: [TypedArray, change-array-by-copy] +features: [Symbol.species, TypedArray, change-array-by-copy] ---*/ -testWithTypedArrayConstructors(TA => { - var ta = new TA(); +testWithTypedArrayConstructors((TA, makeCtorArg) => { + var ta = new TA(makeCtorArg(0)); ta.constructor = TA === Uint8Array ? Int32Array : Uint8Array; assert.sameValue(Object.getPrototypeOf(ta.toReversed()), TA.prototype); - ta = new TA(); + ta = new TA(makeCtorArg(0)); ta.constructor = { [Symbol.species]: TA === Uint8Array ? Int32Array : Uint8Array, }; assert.sameValue(Object.getPrototypeOf(ta.toReversed()), TA.prototype); - ta = new TA(); + ta = new TA(makeCtorArg(0)); Object.defineProperty(ta, "constructor", { get() { throw new Test262Error("Should not get .constructor"); } }); ta.toReversed(); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toReversed/length-property-ignored.js b/test/built-ins/TypedArray/prototype/toReversed/length-property-ignored.js index b2c058514e8..87806657413 100644 --- a/test/built-ins/TypedArray/prototype/toReversed/length-property-ignored.js +++ b/test/built-ins/TypedArray/prototype/toReversed/length-property-ignored.js @@ -27,9 +27,9 @@ testWithTypedArrayConstructors((TA, makeCtorArg) => { res = ta.toReversed(); assert.compareArray(res, [2, 1, 0]); assert.sameValue(res.length, 3); -}, null, ["passthrough"]); +}); -function setLength(length) { +function setLengthOnPrototype(length) { Object.defineProperty(TypedArray.prototype, "length", { get: () => length, }); @@ -38,13 +38,13 @@ function setLength(length) { testWithTypedArrayConstructors((TA, makeCtorArg) => { var ta = new TA(makeCtorArg([0, 1, 2])); - setLength(2); + setLengthOnPrototype(2); var res = ta.toReversed(); - setLength(3); + setLengthOnPrototype(3); assert.compareArray(res, [2, 1, 0]); - setLength(5); + setLengthOnPrototype(5); res = ta.toReversed(); - setLength(3); + setLengthOnPrototype(3); assert.compareArray(res, [2, 1, 0]); }, null, ["passthrough"]); diff --git a/test/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js b/test/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js index 329157b1864..03dbaa699f1 100644 --- a/test/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js +++ b/test/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js @@ -34,11 +34,11 @@ Object.entries(invalidValues).forEach(value => { }, `${value[0]} is not a valid TypedArray`); }); -testWithTypedArrayConstructors(function(TA) { - let buffer = new ArrayBuffer(8); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + let buffer = makeCtorArg(8); let sample = new TA(buffer, 0, 1); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, () => { sample.toReversed(); }, `array has a detached buffer`); -}, null, ["passthrough"]); +}, null, ["arraybuffer"], ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/toSorted/ignores-species.js b/test/built-ins/TypedArray/prototype/toSorted/ignores-species.js index 9d17f00adf7..72fca6bb221 100644 --- a/test/built-ins/TypedArray/prototype/toSorted/ignores-species.js +++ b/test/built-ins/TypedArray/prototype/toSorted/ignores-species.js @@ -17,25 +17,25 @@ info: | 2. Let constructor be the intrinsic object listed in column one of Table 63 for exemplar.[[TypedArrayName]]. ... includes: [testTypedArray.js] -features: [TypedArray, change-array-by-copy] +features: [Symbol.species, TypedArray, change-array-by-copy] ---*/ -testWithTypedArrayConstructors(TA => { - var ta = new TA(); +testWithTypedArrayConstructors((TA, makeCtorArg) => { + var ta = new TA(makeCtorArg(0)); ta.constructor = TA === Uint8Array ? Int32Array : Uint8Array; assert.sameValue(Object.getPrototypeOf(ta.toSorted()), TA.prototype); - ta = new TA(); + ta = new TA(makeCtorArg(0)); ta.constructor = { [Symbol.species]: TA === Uint8Array ? Int32Array : Uint8Array, }; assert.sameValue(Object.getPrototypeOf(ta.toSorted()), TA.prototype); - ta = new TA(); + ta = new TA(makeCtorArg(0)); Object.defineProperty(ta, "constructor", { get() { throw new Test262Error("Should not get .constructor"); } }); ta.toSorted(); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js b/test/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js index e2f6eed387c..cdb76902557 100644 --- a/test/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js +++ b/test/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js @@ -27,9 +27,9 @@ testWithTypedArrayConstructors((TA, makeCtorArg) => { res = ta.toSorted(); assert.compareArray(res, [1, 2, 3]); assert.sameValue(res.length, 3); -}, null, ["passthrough"]); +}); -function setLength(length) { +function setLengthOnPrototype(length) { Object.defineProperty(TypedArray.prototype, "length", { get: () => length, }); @@ -38,14 +38,14 @@ function setLength(length) { testWithTypedArrayConstructors((TA, makeCtorArg) => { var ta = new TA(makeCtorArg([3, 1, 2])); - setLength(2); + setLengthOnPrototype(2); var res = ta.toSorted(); - setLength(3); + setLengthOnPrototype(3); assert.compareArray(res, [1, 2, 3]); - setLength(5); + setLengthOnPrototype(5); res = ta.toSorted(); - setLength(3); + setLengthOnPrototype(3); assert.compareArray(res, [1, 2, 3]); }, null, ["passthrough"]); diff --git a/test/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js b/test/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js index 5dec68e2e60..581ef3cddb0 100644 --- a/test/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js +++ b/test/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js @@ -34,11 +34,11 @@ Object.entries(invalidValues).forEach(value => { }, `${value[0]} is not a valid TypedArray`); }); -testWithTypedArrayConstructors(function(TA) { - let buffer = new ArrayBuffer(8); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + let buffer = makeCtorArg(8); let sample = new TA(buffer, 0, 1); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, () => { sample.toSorted(); }, `array has a detached buffer`); -}, null, ["passthrough"]); +}, null, ["arraybuffer"], ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/toString/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/toString/BigInt/detached-buffer.js index 7fa87a4d2d5..d1e16980358 100644 --- a/test/built-ins/TypedArray/prototype/toString/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/toString/BigInt/detached-buffer.js @@ -23,10 +23,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.toString(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/toString/detached-buffer.js b/test/built-ins/TypedArray/prototype/toString/detached-buffer.js index 7a0c106721b..72f21c7eb95 100644 --- a/test/built-ins/TypedArray/prototype/toString/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/toString/detached-buffer.js @@ -23,10 +23,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.toString(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/values/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/values/BigInt/detached-buffer.js index 0f92f92091c..d2897fd24e9 100644 --- a/test/built-ins/TypedArray/prototype/values/BigInt/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/values/BigInt/detached-buffer.js @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [BigInt, TypedArray] ---*/ -testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.values(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/values/detached-buffer.js b/test/built-ins/TypedArray/prototype/values/detached-buffer.js index 83833e55698..f94818d158e 100644 --- a/test/built-ins/TypedArray/prototype/values/detached-buffer.js +++ b/test/built-ins/TypedArray/prototype/values/detached-buffer.js @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(1); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(1)); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { sample.values(); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArray/prototype/values/return-itor.js b/test/built-ins/TypedArray/prototype/values/return-itor.js index 047fef4ba54..dba0c048e97 100644 --- a/test/built-ins/TypedArray/prototype/values/return-itor.js +++ b/test/built-ins/TypedArray/prototype/values/return-itor.js @@ -14,8 +14,8 @@ features: [TypedArray] var sample = [0, 42, 64]; -testWithTypedArrayConstructors(function(TA) { - var typedArray = new TA(sample); +testWithTypedArrayConstructors(function(TA, makeCtorArg) { + var typedArray = new TA(makeCtorArg(sample)); var itor = typedArray.values(); var next = itor.next(); @@ -33,4 +33,4 @@ testWithTypedArrayConstructors(function(TA) { next = itor.next(); assert.sameValue(next.value, undefined); assert.sameValue(next.done, true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/with/ignores-species.js b/test/built-ins/TypedArray/prototype/with/ignores-species.js index 9f2d2f99b78..958ef3dc647 100644 --- a/test/built-ins/TypedArray/prototype/with/ignores-species.js +++ b/test/built-ins/TypedArray/prototype/with/ignores-species.js @@ -17,7 +17,7 @@ info: | 2. Let constructor be the intrinsic object listed in column one of Table 63 for exemplar.[[TypedArrayName]]. ... includes: [testTypedArray.js] -features: [TypedArray, change-array-by-copy] +features: [Symbol.species, TypedArray, change-array-by-copy] ---*/ testWithTypedArrayConstructors((TA, makeCtorArg) => { @@ -38,4 +38,4 @@ testWithTypedArrayConstructors((TA, makeCtorArg) => { } }); ta.with(0, 2); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArray/prototype/with/length-property-ignored.js b/test/built-ins/TypedArray/prototype/with/length-property-ignored.js index 8247e43ea12..a776c2f427c 100644 --- a/test/built-ins/TypedArray/prototype/with/length-property-ignored.js +++ b/test/built-ins/TypedArray/prototype/with/length-property-ignored.js @@ -27,9 +27,9 @@ testWithTypedArrayConstructors((TA, makeCtorArg) => { res = ta.with(0, 0); assert.compareArray(res, [0, 1, 2]); assert.sameValue(res.length, 3); -}, null, ["passthrough"]); +}); -function setLength(length) { +function setLengthOnPrototype(length) { Object.defineProperty(TypedArray.prototype, "length", { get: () => length, }); @@ -38,13 +38,13 @@ function setLength(length) { testWithTypedArrayConstructors((TA, makeCtorArg) => { var ta = new TA(makeCtorArg([3, 1, 2])); - setLength(2); + setLengthOnPrototype(2); var res = ta.with(0, 0); - setLength(3); + setLengthOnPrototype(3); assert.compareArray(res, [0, 1, 2]); - setLength(5); + setLengthOnPrototype(5); res = ta.with(0, 0); - setLength(3); + setLengthOnPrototype(3); assert.compareArray(res, [0, 1, 2]); }, null, ["passthrough"]);