diff --git a/harness/propertyHelper.js b/harness/propertyHelper.js index 0acccfe87f0..17360105e38 100644 --- a/harness/propertyHelper.js +++ b/harness/propertyHelper.js @@ -25,6 +25,7 @@ defines: // Capture primordial functions and receiver-uncurried primordial methods that // are used in verification but might be destroyed *by* that process itself. var __isArray = Array.isArray; +var __max = Math.max; var __defineProperty = Object.defineProperty; var __getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var __getOwnPropertyNames = Object.getOwnPropertyNames; @@ -32,7 +33,12 @@ var __join = Function.prototype.call.bind(Array.prototype.join); var __push = Function.prototype.call.bind(Array.prototype.push); var __hasOwnProperty = Function.prototype.call.bind(Object.prototype.hasOwnProperty); var __propertyIsEnumerable = Function.prototype.call.bind(Object.prototype.propertyIsEnumerable); -var nonIndexNumericPropertyName = Math.pow(2, 32) - 1; +var __getTypedArrayByteLength = + Object.getPrototypeOf && + typeof Uint8Array !== "undefined" && + Function.prototype.call.bind( + __getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), "byteLength").get + ); /** * @param {object} obj @@ -119,7 +125,7 @@ function verifyProperty(obj, name, desc, options) { if (__hasOwnProperty(desc, 'configurable') && desc.configurable !== undefined) { if (desc.configurable !== originalDesc.configurable || - desc.configurable !== isConfigurable(obj, name)) { + desc.configurable !== isConfigurable(obj, name, originalDesc)) { __push(failures, label + " descriptor should " + (desc.configurable ? '' : 'not ') + "be configurable"); } } @@ -135,7 +141,30 @@ function verifyProperty(obj, name, desc, options) { return true; } -function isConfigurable(obj, name) { +function toNumber(value) { + // https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-math.max + return __max(value); +} + +// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-canonicalnumericindexstring +function isCanonicalNumericIndexString(value) { + if (typeof value !== "string") return false; + if (value === "-0") return true; + var n = toNumber(value); + return String(n) === value; +} + +function isTypedArray(value) { + try { + // https://tc39.es/ecma262/multipage/indexed-collections.html#sec-get-%typedarray%.prototype.bytelength + __getTypedArrayByteLength(value); + return true; + } catch (_err) { + return false; + } +} + +function isConfigurable(obj, name, originalDesc) { try { delete obj[name]; } catch (e) { @@ -143,7 +172,17 @@ function isConfigurable(obj, name) { throw new Test262Error("Expected TypeError, got " + e); } } - return !__hasOwnProperty(obj, name); + var deleted = !__hasOwnProperty(obj, name); + + // TypedArray canonical numeric string properties are never *actually* deleted, + // so we skip post-hoc verification for them + // https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-typedarray-delete + if (isCanonicalNumericIndexString(name) && isTypedArray(obj) && originalDesc) { + if (deleted) throw new Test262Error("Expected TypedArray index deletion to be ignored"); + return originalDesc.configurable; + } + + return deleted; } function isEnumerable(obj, name) { @@ -172,17 +211,28 @@ function isSameValue(a, b) { } function isWritable(obj, name, verifyProp, value) { - var unlikelyValue = __isArray(obj) && name === "length" ? - nonIndexNumericPropertyName : - "unlikelyValue"; - var newValue = value || unlikelyValue; var hadValue = __hasOwnProperty(obj, name); var oldValue = obj[name]; - var writeSucceeded; - - if (arguments.length < 4 && newValue === oldValue) { - newValue = newValue + "2"; + var newValue = value; + if (newValue === undefined) { + switch (typeof oldValue) { + // To accommodate Array and TypedArray instances, preserve a numeric type. + case "number": + if (oldValue <= 0 || __isArray(obj) && name === "length") { + newValue = oldValue === -Infinity ? 0 : oldValue + 1; + } else { + newValue = oldValue === Infinity ? 1 : oldValue - 1; + } + break; + case "bigint": + newValue = oldValue <= BigInt(0) ? oldValue + BigInt(1) : oldValue - BigInt(1); + break; + default: + newValue = oldValue !== "unlikelyValue" ? "unlikelyValue" : "unlikelyValue2"; + break; + } } + var writeSucceeded; try { obj[name] = newValue; diff --git a/harness/testTypedArray.js b/harness/testTypedArray.js index a6418c2f70b..93804731036 100644 --- a/harness/testTypedArray.js +++ b/harness/testTypedArray.js @@ -220,7 +220,7 @@ function ctorArgFactoryMatchesSome(argFactory, features) { if (argFactory === makeImmutableArrayBuffer) return true; break; default: - throw Test262Error("unknown feature: " + features[i]); + throw new Test262Error("unknown feature: " + features[i]); } } return false; @@ -271,7 +271,7 @@ function testWithAllTypedArrayConstructors(f, constructors, includeArgFactories, } } if (ctorArgFactories.length === 0) { - throw Test262Error("no arg factories match include " + includeArgFactories + " and exclude " + excludeArgFactories); + throw new Test262Error("no arg factories match include " + includeArgFactories + " and exclude " + excludeArgFactories); } for (var k = 0; k < ctorArgFactories.length; ++k) { var argFactory = ctorArgFactories[k]; diff --git a/test/built-ins/Atomics/add/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/add/bigint/non-shared-bufferdata.js index c0ed426b7af..7b167b59640 100644 --- a/test/built-ins/Atomics/add/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/add/bigint/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(buffer); assert.sameValue(Atomics.add(view, 0, 1n), 0n, 'Atomics.add(view, 0, 1n) returns 0n'); assert.sameValue(Atomics.load(view, 0), 1n, 'Atomics.load(view, 0) returns 1n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/add/non-shared-bufferdata.js b/test/built-ins/Atomics/add/non-shared-bufferdata.js index ca82b20116f..33459c0196d 100644 --- a/test/built-ins/Atomics/add/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/add/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.add(view, 0, 1), 0, 'Atomics.add(view, 0, 1) returns 0'); assert.sameValue(Atomics.load(view, 0), 1, 'Atomics.load(view, 0) returns 1'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/add/non-shared-int-views-throws.js b/test/built-ins/Atomics/add/non-shared-int-views-throws.js index 1a0e9a231b2..183a5a7023b 100644 --- a/test/built-ins/Atomics/add/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/add/non-shared-int-views-throws.js @@ -15,4 +15,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.add(view, 0, 1); }, `Atomics.add(new ${TA.name}(buffer), 0, 1) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/and/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/and/bigint/non-shared-bufferdata.js index c677e9cbcfa..a66004e5d80 100644 --- a/test/built-ins/Atomics/and/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/and/bigint/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(buffer); assert.sameValue(Atomics.and(view, 0, 1n), 0n, 'Atomics.and(view, 0, 1n) returns 0n'); assert.sameValue(Atomics.load(view, 0), 0n, 'Atomics.load(view, 0) returns 0n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/and/non-shared-bufferdata.js b/test/built-ins/Atomics/and/non-shared-bufferdata.js index 12fcd57a3dc..89aa65d6ada 100644 --- a/test/built-ins/Atomics/and/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/and/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.and(view, 0, 1), 0, 'Atomics.and(view, 0, 1) returns 0'); assert.sameValue(Atomics.load(view, 0), 0, 'Atomics.load(view, 0) returns 0'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/and/non-shared-int-views-throws.js b/test/built-ins/Atomics/and/non-shared-int-views-throws.js index 74d7d21858c..a8e0f93859a 100644 --- a/test/built-ins/Atomics/and/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/and/non-shared-int-views-throws.js @@ -15,4 +15,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.and(view, 0, 1); }, `Atomics.and(new ${TA.name}(buffer), 0, 1) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/compareExchange/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/compareExchange/bigint/non-shared-bufferdata.js index 3322221da8c..30d029f66bf 100644 --- a/test/built-ins/Atomics/compareExchange/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/compareExchange/bigint/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(buffer); assert.sameValue(Atomics.compareExchange(view, 0, 0n, 1n), 0n, 'Atomics.compareExchange(view, 0, 0n, 1n) returns 0n'); assert.sameValue(Atomics.load(view, 0), 1n, 'Atomics.load(view, 0) returns 1n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/compareExchange/non-shared-bufferdata.js b/test/built-ins/Atomics/compareExchange/non-shared-bufferdata.js index e808423814e..18455d284d8 100644 --- a/test/built-ins/Atomics/compareExchange/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/compareExchange/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.compareExchange(view, 0, 0, 1), 0, 'Atomics.compareExchange(view, 0, 0, 1) returns 0'); assert.sameValue(Atomics.load(view, 0), 1, 'Atomics.load(view, 0) returns 1'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/compareExchange/non-shared-int-views-throws.js b/test/built-ins/Atomics/compareExchange/non-shared-int-views-throws.js index 3ef0e4b6126..8cf26fa424e 100644 --- a/test/built-ins/Atomics/compareExchange/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/compareExchange/non-shared-int-views-throws.js @@ -15,4 +15,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.compareExchange(view, 0, 0, 0); }, `Atomics.compareExchange(new ${TA.name}(buffer), 0, 0, 0) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/exchange/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/exchange/bigint/non-shared-bufferdata.js index 1257b4e8828..4e659846e8b 100644 --- a/test/built-ins/Atomics/exchange/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/exchange/bigint/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(buffer); assert.sameValue(Atomics.exchange(view, 0, 1n), 0n, 'Atomics.exchange(view, 0, 1n) returns 0n'); assert.sameValue(Atomics.load(view, 0), 1n, 'Atomics.load(view, 0) returns 1n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/exchange/non-shared-bufferdata.js b/test/built-ins/Atomics/exchange/non-shared-bufferdata.js index de36d4fd17e..fc5a1147fb1 100644 --- a/test/built-ins/Atomics/exchange/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/exchange/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.exchange(view, 0, 1), 0, 'Atomics.exchange(view, 0, 1) returns 0'); assert.sameValue(Atomics.load(view, 0), 1, 'Atomics.load(view, 0) returns 1'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/exchange/non-shared-int-views-throws.js b/test/built-ins/Atomics/exchange/non-shared-int-views-throws.js index 5e4bc4447d9..1f8d98b7542 100644 --- a/test/built-ins/Atomics/exchange/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/exchange/non-shared-int-views-throws.js @@ -14,4 +14,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.exchange(view, 0, 1); }, `Atomics.exchange(new ${TA.name}(buffer), 0, 1) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/load/bad-range.js b/test/built-ins/Atomics/load/bad-range.js index 5c2e37c8067..078121d0573 100644 --- a/test/built-ins/Atomics/load/bad-range.js +++ b/test/built-ins/Atomics/load/bad-range.js @@ -10,13 +10,12 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -var views = nonClampedIntArrayConstructors.slice(); -testWithTypedArrayConstructors(function(TA) { +testWithAtomicsFriendlyTypedArrayConstructors(function(TA) { let view = new TA(buffer); testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.load(view, IdxGen(view)); }); }); -}, views, ["passthrough"]); +}, null, ["passthrough"]); diff --git a/test/built-ins/Atomics/load/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/load/bigint/non-shared-bufferdata.js index 08d782a9138..be6e4f8db06 100644 --- a/test/built-ins/Atomics/load/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/load/bigint/non-shared-bufferdata.js @@ -11,4 +11,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const buffer = makeCtorArg(4); const view = new TA(buffer); assert.sameValue(Atomics.load(view, 0), 0n, 'Atomics.load(view, 0) returns 0n'); -}, null, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/load/non-shared-bufferdata.js b/test/built-ins/Atomics/load/non-shared-bufferdata.js index e15e6605785..fbb6110d40d 100644 --- a/test/built-ins/Atomics/load/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/load/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(makeCtorArg(4)); assert.sameValue(Atomics.load(view, 0), 0, 'Atomics.load(view, 0) returns 0'); -}, null, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/load/non-shared-int-views-throws.js b/test/built-ins/Atomics/load/non-shared-int-views-throws.js index 02437f7ba5c..9df4b7c27bd 100644 --- a/test/built-ins/Atomics/load/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/load/non-shared-int-views-throws.js @@ -14,4 +14,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.load(view, 0); }, `Atomics.load(new ${TA.name}(buffer), 0) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js b/test/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js index 2881f15baa0..53381e7a7e9 100644 --- a/test/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js +++ b/test/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js @@ -32,9 +32,9 @@ var index = { } }; -for (var badArrayType of nonAtomicsFriendlyTypedArrayConstructors) { - var typedArray = new badArrayType(new SharedArrayBuffer(8)); +testWithNonAtomicsFriendlyTypedArrayConstructors(function(TA) { + var typedArray = new TA(new SharedArrayBuffer(8)); assert.throws(TypeError, function() { Atomics.load(typedArray, index); }); -} +}, ["passthrough"]); diff --git a/test/built-ins/Atomics/or/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/or/bigint/non-shared-bufferdata.js index f5cd4acac7e..c5b689b2c62 100644 --- a/test/built-ins/Atomics/or/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/or/bigint/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(buffer); assert.sameValue(Atomics.or(view, 0, 1n), 0n, 'Atomics.or(view, 0, 1n) returns 0n'); assert.sameValue(Atomics.load(view, 0), 1n, 'Atomics.load(view, 0) returns 1n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/or/non-shared-bufferdata.js b/test/built-ins/Atomics/or/non-shared-bufferdata.js index 8bfc4a13f7a..38d69dcce55 100644 --- a/test/built-ins/Atomics/or/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/or/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.or(view, 0, 1), 0, 'Atomics.or(view, 0, 1) returns 0'); assert.sameValue(Atomics.load(view, 0), 1, 'Atomics.load(view, 0) returns 1'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/or/non-shared-int-views-throws.js b/test/built-ins/Atomics/or/non-shared-int-views-throws.js index dfbbeedfbac..e4d1278cf5c 100644 --- a/test/built-ins/Atomics/or/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/or/non-shared-int-views-throws.js @@ -15,4 +15,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.or(view, 0, 1); }, `Atomics.or(new ${TA.name}(buffer), 0, 1) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/store/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/store/bigint/non-shared-bufferdata.js index 03a68db18e0..5cab6618376 100644 --- a/test/built-ins/Atomics/store/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/store/bigint/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(buffer); assert.sameValue(Atomics.store(view, 0, 1n), 1n, 'Atomics.store(view, 0, 1n) returns 1n'); assert.sameValue(Atomics.load(view, 0), 1n, 'Atomics.load(view, 0) returns 1n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/store/non-shared-bufferdata.js b/test/built-ins/Atomics/store/non-shared-bufferdata.js index 680e3fc41c1..5701194d50a 100644 --- a/test/built-ins/Atomics/store/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/store/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.store(view, 0, 1), 1, 'Atomics.store(view, 0, 1) returns 1'); assert.sameValue(Atomics.load(view, 0), 1, 'Atomics.load(view, 0) returns 1'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/store/non-shared-int-views-throws.js b/test/built-ins/Atomics/store/non-shared-int-views-throws.js index a38b97af592..eddf65b040a 100644 --- a/test/built-ins/Atomics/store/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/store/non-shared-int-views-throws.js @@ -15,4 +15,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.store(view, 0, 1); }, `Atomics.store(new ${TA.name}(buffer), 0, 1) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/sub/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/sub/bigint/non-shared-bufferdata.js index 7fffa5fd179..65c9e97f9ba 100644 --- a/test/built-ins/Atomics/sub/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/sub/bigint/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.store(view, 0, 1n), 1n, 'Atomics.store(view, 0, 1n) returns 1n'); assert.sameValue(Atomics.sub(view, 0, 1n), 1n, 'Atomics.sub(view, 0, 1n) returns 1n'); assert.sameValue(Atomics.load(view, 0), 0n, 'Atomics.load(view, 0) returns 0n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/sub/non-shared-bufferdata.js b/test/built-ins/Atomics/sub/non-shared-bufferdata.js index 40c91a2cd70..389d1491d96 100644 --- a/test/built-ins/Atomics/sub/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/sub/non-shared-bufferdata.js @@ -14,4 +14,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.store(view, 0, 1), 1, 'Atomics.store(view, 0, 1) returns 1'); assert.sameValue(Atomics.sub(view, 0, 1), 1, 'Atomics.sub(view, 0, 1) returns 1'); assert.sameValue(Atomics.load(view, 0), 0, 'Atomics.load(view, 0) returns 0'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/sub/non-shared-int-views-throws.js b/test/built-ins/Atomics/sub/non-shared-int-views-throws.js index b055bf714ac..da9a7d1ddd4 100644 --- a/test/built-ins/Atomics/sub/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/sub/non-shared-int-views-throws.js @@ -15,4 +15,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.sub(view, 0, 1); }, `Atomics.sub(new ${TA.name}(buffer), 0, 1) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/Atomics/xor/bigint/non-shared-bufferdata.js b/test/built-ins/Atomics/xor/bigint/non-shared-bufferdata.js index 74b768bc9b8..feca2301f45 100644 --- a/test/built-ins/Atomics/xor/bigint/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/xor/bigint/non-shared-bufferdata.js @@ -12,4 +12,4 @@ testWithBigIntTypedArrayConstructors((TA, makeCtorArg) => { const view = new TA(buffer); assert.sameValue(Atomics.xor(view, 0, 1n), 0n, 'Atomics.xor(view, 0, 1n) returns 0n'); assert.sameValue(Atomics.load(view, 0), 1n, 'Atomics.load(view, 0) returns 1n'); -}, null, ["arraybuffer"], ["immutable"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/Atomics/xor/non-shared-bufferdata.js b/test/built-ins/Atomics/xor/non-shared-bufferdata.js index ca5e3bb7315..c74cc561370 100644 --- a/test/built-ins/Atomics/xor/non-shared-bufferdata.js +++ b/test/built-ins/Atomics/xor/non-shared-bufferdata.js @@ -13,4 +13,4 @@ testWithAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.sameValue(Atomics.xor(view, 0, 1), 0, 'Atomics.xor(view, 0, 1) returns 0'); assert.sameValue(Atomics.load(view, 0), 1, 'Atomics.load(view, 0) returns 1'); -}, ["arraybuffer"], ["immutable"]); +}, null, ["immutable"]); diff --git a/test/built-ins/Atomics/xor/non-shared-int-views-throws.js b/test/built-ins/Atomics/xor/non-shared-int-views-throws.js index 6014382047d..7a06c91b9c7 100644 --- a/test/built-ins/Atomics/xor/non-shared-int-views-throws.js +++ b/test/built-ins/Atomics/xor/non-shared-int-views-throws.js @@ -15,4 +15,4 @@ testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => { assert.throws(TypeError, function() { Atomics.xor(view, 0, 1); }, `Atomics.xor(new ${TA.name}(buffer), 0, 1) throws TypeError`); -}, ["arraybuffer"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/desc-value-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/desc-value-throws.js index c0dcd1c2fb4..97c35eec503 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/desc-value-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/desc-value-throws.js @@ -49,4 +49,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { Object.defineProperty(sample, "0", {value: obj}); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js index 2a46ff32211..27e7420c69f 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js @@ -44,4 +44,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { false, "numericIndex > length" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js index a34931d9f63..84f09a06ef3 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js @@ -31,4 +31,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { false, "-1" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js index 8682e8f8885..34ac1b9fa18 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js @@ -33,4 +33,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { ); assert.sameValue(sample[0], 0n, "does not change the value for [0]"); assert.sameValue(sample["-0"], undefined, "does define a value for ['-0']"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-canonical-index.js index 041a12282e0..ee2f7ef53b3 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-canonical-index.js @@ -34,7 +34,7 @@ var acDesc = { configurable: false }; -testWithBigIntTypedArrayConstructors(function(TA) { +testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { keys.forEach(function(key) { var dataDesc = { value: 42n, @@ -42,7 +42,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { configurable: true }; - var sample1 = new TA(); + var sample1 = new TA(makeCtorArg(0)); assert.sameValue( Reflect.defineProperty(sample1, key, dataDesc), @@ -58,7 +58,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(sample1[0], undefined, "no value is set on sample1[0]"); assert.sameValue(sample1.length, 0, "length is still 0"); - var sample2 = new TA(); + var sample2 = new TA(makeCtorArg(0)); assert.sameValue( Reflect.defineProperty(sample2, key, acDesc), @@ -75,7 +75,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(sample2[0], undefined,"no value is set on sample2[0]"); assert.sameValue(sample2.length, 0, "length is still 0"); - var sample3 = new TA(); + var sample3 = new TA(makeCtorArg(0)); Object.preventExtensions(sample3); assert.sameValue( @@ -85,7 +85,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { ); assert.sameValue(Object.getOwnPropertyDescriptor(sample3, key), undefined); - var sample4 = new TA(); + var sample4 = new TA(makeCtorArg(0)); Object.preventExtensions(sample4); assert.sameValue( @@ -95,4 +95,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { ); assert.sameValue(Object.getOwnPropertyDescriptor(sample4, key), undefined); }); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js index 7d821444421..6480a0d0a41 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-integer.js @@ -121,4 +121,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "'-Infinity' - does not define a value for ['-Infinity']" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index-throws.js index a23677333fd..babda1073ab 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index-throws.js @@ -42,4 +42,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(TypeError, function() { Object.defineProperty(sample, "-0", desc); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index.js index 6a92f54ac0a..84518b20c66 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index.js @@ -49,4 +49,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(desc.set, fnset, "accessor's set"); verifyNotEnumerable(sample, "bar"); verifyConfigurable(sample, "bar"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc-throws.js index 12d11aecd4f..0e8d978e261 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc-throws.js @@ -41,4 +41,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }); }, "get and set accessors"); assert.sameValue(sample[0], 0n, "get and set accessors - side effect check"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc.js index b87fc1babfe..9de08ffb89b 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc.js @@ -55,4 +55,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "get and set accessors" ); assert.sameValue(sample[0], 0n, "get and set accessors - side effect check"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js index 66d8d765f5e..32602768ad3 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js @@ -33,4 +33,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "defineProperty's result" ); assert.sameValue(sample[0], 42n, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-configurable-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-configurable-throws.js index 3ce20bcf882..6d9121456cb 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-configurable-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-configurable-throws.js @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }, "complete descriptor"); assert.sameValue(sample[0], 0n, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable-throws.js index d0992d03407..8c4f7eba1b6 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable-throws.js @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }, "complete descriptor"); assert.sameValue(sample[0], 0n, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js index d7fb2b6f5be..d9df5082c76 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js @@ -32,4 +32,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "defineProperty's result" ); assert.sameValue(sample[0], 0n, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable-throws.js index a0932f07aa7..6912a7b1410 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable-throws.js @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }, "complete descriptor"); assert.sameValue(sample[0], 0n, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js index 5bc0147c55a..e9ceab9310a 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js @@ -32,4 +32,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "defineProperty's result" ); assert.sameValue(sample[0], 0n, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex.js index 42dd225d347..aa138cd9bb2 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-numericindex.js @@ -35,4 +35,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(desc.configurable, true, 'The value of desc.configurable is true'); assert.sameValue(desc.enumerable, true, 'The value of desc.enumerable is true'); assert.sameValue(desc.writable, true, 'The value of desc.writable is true'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-symbol.js index 837d7fedbcd..234d83a40fa 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/key-is-symbol.js @@ -51,4 +51,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(desc.set, fnset, "accessor's set"); assert.sameValue(desc.enumerable, true); verifyNotConfigurable(sample, s2); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-new-key.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-new-key.js index 373e1763b4d..7a42a0db74f 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-new-key.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-new-key.js @@ -41,4 +41,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { ); assert.sameValue(Object.getOwnPropertyDescriptor(sample, "bar"), undefined); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-redefine-key.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-redefine-key.js index 8f1db526f67..d807a02d687 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-redefine-key.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/non-extensible-redefine-key.js @@ -54,4 +54,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(desc.set, fnset, "accessor's set"); verifyNotEnumerable(sample, "bar"); verifyNotConfigurable(sample, "bar"); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/set-value.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/set-value.js index ad5d0a338e2..a2af1030efa 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/set-value.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/set-value.js @@ -52,4 +52,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample[0], 1n, "sample[0]"); assert.sameValue(sample[1], 2n, "sample[1]"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/this-is-not-extensible.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/this-is-not-extensible.js index 73c31f6ff38..db624961d3c 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/this-is-not-extensible.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/this-is-not-extensible.js @@ -28,4 +28,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var s = Symbol("1"); assert.sameValue(Reflect.defineProperty(sample, s, {value:42}), false); assert.sameValue(Reflect.getOwnPropertyDescriptor(sample, s), undefined); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js index 0a3472e4ba6..52c589e7af5 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js @@ -60,4 +60,4 @@ testTypedArrayConversions(byteConversionValues, function(TA, value, expected, in Object.defineProperty(sample, "0", {value: value}); assert.sameValue(sample[0], expected, value + " converts to " + expected); -}); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js index 2f4d3a35ec2..c6fb6a7e3b3 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js @@ -47,4 +47,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { Object.defineProperty(sample, "0", {value: obj}); }); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/immutable-buffer.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/immutable-buffer.js new file mode 100644 index 00000000000..8858cd9443f --- /dev/null +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/immutable-buffer.js @@ -0,0 +1,112 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray-defineownproperty +description: > + When the backing buffer is immutable, properties for in-bounds indexes are + validated to be non-configurable, enumerable, non-writable, and + value-preserving. +info: | + [[DefineOwnProperty]] ( P, Desc ) + 1. If P is a String, then + a. Let numericIndex be CanonicalNumericIndexString(P). + b. If numericIndex is not undefined, then + i. If IsValidIntegerIndex(O, numericIndex) is false, return false. + ii. If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, then + 1. Let current be ! O.[[GetOwnProperty]](P). + 2. Assert: current.[[Configurable]] and current.[[Writable]] are both false. + 3. NOTE: Attempting to redefine an immutable value always fails, even if the new value would be cast to the current value. + 4. Return ValidateAndApplyPropertyDescriptor(O, P, false, Desc, current). +features: [TypedArray, immutable-arraybuffer] +includes: [testTypedArray.js, compareArray.js, deepEqual.js] +---*/ + +function reprDesc(desc) { + var str = JSON.stringify(desc, function(_key, value) { + if (typeof value === "bigint") return String(value) + "n"; + if (isNegativeZero(value)) return "-0"; + return value; + }); + return str.replace(/"([0-9]+n|-0)"/, "$1"); +} + +testWithAllTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(["0", "1"])); + var descriptor = Object.getOwnPropertyDescriptor(sample, "0"); + + // Reuse of existing property attributes (possibly partial) succeeds but has + // no effect. + for (var v = 0; v < 2; v++) { + for (var c = 0; c < 2; c++) { + for (var e = 0; e < 2; e++) { + for (var w = 0; w < 2; w++) { + var newDesc = {}; + if (v) newDesc.value = descriptor.value; + if (c) newDesc.configurable = descriptor.configurable; + if (e) newDesc.enumerable = descriptor.enumerable; + if (w) newDesc.writable = descriptor.writable; + + if (typeof Reflect !== "undefined" && Reflect.defineProperty) { + assert.sameValue(Reflect.defineProperty(sample, "0", newDesc), true, + "Reflect.defineProperty " + reprDesc(newDesc)); + assert.deepEqual(Object.getOwnPropertyDescriptor(sample, "0"), descriptor, + "results of Reflect.defineProperty " + reprDesc(newDesc)); + } + Object.defineProperty(sample, "0", newDesc); + assert.deepEqual(Object.getOwnPropertyDescriptor(sample, "0"), descriptor, + "results of Object.defineProperty " + reprDesc(newDesc)); + } + } + } + } + + // Extension of each of the above to include one or invalidating attributes fails + // with no effect. + var badValues = ["0", -0]; + for (var v = 0; v < 2; v++) { + for (var c = 0; c < 2; c++) { + for (var e = 0; e < 2; e++) { + for (var w = 0; w < 2; w++) { + for (var vx = 0; vx <= badValues.length; vx++) { + for (var cx = 0; cx < 2; cx++) { + for (var ex = 0; ex < 2; ex++) { + for (var wx = 0; wx < 2; wx++) { + // Require at least one bad attribute. + if (!vx && !cx && !ex && !wx) continue; + // To avoid redundancy, introduce bad attributes only additively + // (i.e., rather than by overwriting a good attribute). + if ((v && vx) || (c && cx) || (e && ex) || (w && wx)) continue; + + var badDesc = {}; + + if (v) badDesc.value = descriptor.value; + if (c) badDesc.configurable = descriptor.configurable; + if (e) badDesc.enumerable = descriptor.enumerable; + if (w) badDesc.writable = descriptor.writable; + + if (vx) badDesc.value = badValues[vx - 1]; + if (cx) badDesc.configurable = !descriptor.configurable; + if (ex) badDesc.enumerable = !descriptor.enumerable; + if (wx) badDesc.writable = !descriptor.writable; + + if (typeof Reflect !== "undefined" && Reflect.defineProperty) { + assert.sameValue(Reflect.defineProperty(sample, "0", badDesc), false, + "Reflect.defineProperty " + reprDesc(badDesc)); + assert.deepEqual(Object.getOwnPropertyDescriptor(sample, "0"), descriptor, + "results of Reflect.defineProperty " + reprDesc(badDesc)); + } + assert.throws(TypeError, function() { + Object.defineProperty(sample, "0", badDesc); + }, "Object.defineProperty " + reprDesc(badDesc)); + assert.deepEqual(Object.getOwnPropertyDescriptor(sample, "0"), descriptor, + "results of Object.defineProperty " + reprDesc(badDesc)); + } + } + } + } + } + } + } + } +}, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.js index 7ab2fe146d8..53f33ffd37f 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.js @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { false, "numericIndex > length" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.js index 9cb0a2259fd..35df351a46d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.js @@ -31,4 +31,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { false, "-1" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.js index d8197312090..2e8135f1946 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.js @@ -33,4 +33,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { ); assert.sameValue(sample[0], 0, "does not change the value for [0]"); assert.sameValue(sample["-0"], undefined, "does define a value for ['-0']"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.js index 66eb3ad395e..b29ebdbdd7a 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.js @@ -40,9 +40,9 @@ var acDesc = { configurable: false }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, makeCtorArg) { keys.forEach(function(key) { - var sample1 = new TA(); + var sample1 = new TA(makeCtorArg(0)); assert.sameValue( Reflect.defineProperty(sample1, key, dataDesc), @@ -58,7 +58,7 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(sample1[0], undefined, "no value is set on sample1[0]"); assert.sameValue(sample1.length, 0, "length is still 0"); - var sample2 = new TA(); + var sample2 = new TA(makeCtorArg(0)); assert.sameValue( Reflect.defineProperty(sample2, key, acDesc), @@ -75,7 +75,7 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(sample2[0], undefined,"no value is set on sample2[0]"); assert.sameValue(sample2.length, 0, "length is still 0"); - var sample3 = new TA(); + var sample3 = new TA(makeCtorArg(0)); Object.preventExtensions(sample3); assert.sameValue( @@ -85,7 +85,7 @@ testWithTypedArrayConstructors(function(TA) { ); assert.sameValue(Object.getOwnPropertyDescriptor(sample3, key), undefined); - var sample4 = new TA(); + var sample4 = new TA(makeCtorArg(0)); Object.preventExtensions(sample4); assert.sameValue( @@ -95,4 +95,4 @@ testWithTypedArrayConstructors(function(TA) { ); assert.sameValue(Object.getOwnPropertyDescriptor(sample4, key), undefined); }); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.js index 7c2b5592e4b..5a015885dba 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.js @@ -121,4 +121,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "'-Infinity' - does not define a value for ['-Infinity']" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js index 35a074bf5d1..48f43ef31f8 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(TypeError, function() { Object.defineProperty(sample, "-0", desc); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.js index e22db7397d3..cca395303f3 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.js @@ -49,4 +49,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(desc.set, fnset, "accessor's set"); verifyNotEnumerable(sample, "bar"); verifyConfigurable(sample, "bar"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js index 5a573188f94..a69b5189137 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js @@ -41,4 +41,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }); }, "get and set accessors"); assert.sameValue(sample[0], 0, "get and set accessors - side effect check"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js index f7fd66d408a..ee6db3087b0 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js @@ -55,4 +55,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "get and set accessors" ); assert.sameValue(sample[0], 0, "get and set accessors - side effect check"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js index 7a385a3fd0f..f1a3d760d7d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js @@ -33,4 +33,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "defineProperty's result" ); assert.sameValue(sample[0], 42, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js index 898cf1abca7..d8d2e8bd7c2 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }, "complete descriptor"); assert.sameValue(sample[0], 0, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js index cf0b3f1a3ce..1bd49a45fcd 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }, "complete descriptor"); assert.sameValue(sample[0], 0, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js index 43ebb77ec94..07014093ec6 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js @@ -32,4 +32,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "defineProperty's result" ); assert.sameValue(sample[0], 0, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js index 70507812b72..b7cc6b3d37a 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }, "complete descriptor"); assert.sameValue(sample[0], 0, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js index 9be636eecac..26e6bfe99bd 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js @@ -32,4 +32,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "defineProperty's result" ); assert.sameValue(sample[0], 0, "side effect check"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.js index a91a2e3ddea..1e213279042 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.js @@ -42,4 +42,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(descriptor0.configurable, true); assert.sameValue(descriptor0.enumerable, true); assert.sameValue(descriptor0.writable, true); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.js index c0ca5d0a2da..31cf055518d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.js @@ -51,4 +51,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(desc.set, fnset, "accessor's set"); assert.sameValue(desc.enumerable, true); verifyNotConfigurable(sample, s2); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.js index 21d8fede075..e398c6713b4 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.js @@ -41,4 +41,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { ); assert.sameValue(Object.getOwnPropertyDescriptor(sample, "bar"), undefined); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.js index bc17c944ed3..f5c61bd19c6 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.js @@ -54,4 +54,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(desc.set, fnset, "accessor's set"); verifyNotEnumerable(sample, "bar"); verifyNotConfigurable(sample, "bar"); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js index c3b4edcd003..f2e92399fed 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js @@ -52,4 +52,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample[0], 1, "sample[0]"); assert.sameValue(sample[1], 2, "sample[1]"); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.js index 7fa04d17729..dfb79b0e65f 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.js @@ -28,4 +28,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { var s = Symbol("1"); assert.sameValue(Reflect.defineProperty(sample, s, {value:42}), false); assert.sameValue(Reflect.getOwnPropertyDescriptor(sample, s), undefined); -}, null, ["passthrough"]); +}, null, null, ["resizable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-non-strict.js index 360bf946a44..ed4a30cd1a4 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-non-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-non-strict.js @@ -64,4 +64,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { delete TypedArray.prototype[key]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict.js index 1c011386453..0db959850a7 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict.js @@ -63,4 +63,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { delete TypedArray.prototype[key]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-non-strict.js index 8c2a8d8301b..83a096c6d96 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-non-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-non-strict.js @@ -41,4 +41,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(delete sample["-0"], true, 'The value of `delete sample["-0"]` is true'); assert.sameValue(delete sample[-0], false, 'The value of `delete sample[-0]` is false'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict.js index 04ec904c144..ef1c9ec2326 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict.js @@ -43,4 +43,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(TypeError, () => { delete sample[-0]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js index 21306834400..db902dbd1b8 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js @@ -35,4 +35,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, () => { sample.foo; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-non-strict.js index 2e78eaf1f6c..abe4546b705 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-non-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-non-strict.js @@ -41,4 +41,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(delete sample.bar, false, 'The value of `delete sample.bar` is false'); assert.sameValue(delete sample.baz, true, 'The value of `delete sample.baz` is true'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict.js index 9cb02ad7a42..7b4e51c4e4b 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict.js @@ -44,4 +44,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }); assert.sameValue(delete sample.baz, true, 'The value of `delete sample.baz` is true'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js index 228ac32e3f6..620e0a37114 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js @@ -64,4 +64,4 @@ testWithTypedArrayConstructors(function(TA) { delete TypedArray.prototype[key]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict.js index 06974366ecf..16ab4397817 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict.js @@ -63,4 +63,4 @@ testWithTypedArrayConstructors(function(TA) { delete TypedArray.prototype[key]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js index f94299e5f4d..f4f9b9da2cc 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js @@ -39,4 +39,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(delete sample["1.1"], true, 'The value of `delete sample["1.1"]` is true'); assert.sameValue(delete sample[1.1], true, 'The value of `delete sample[1.1]` is true'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js index dda8910e955..6b055af121d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js @@ -41,4 +41,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(delete sample["-0"], true, 'The value of `delete sample["-0"]` is true'); assert.sameValue(delete sample[-0], false, 'The value of `delete sample[-0]` is false'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict.js index d9300768792..0fcd2cf68a9 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict.js @@ -43,4 +43,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(TypeError, () => { delete sample[-0]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js index ce81abbffd7..dd852a469b9 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, () => { sample.foo; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js index 63e76ed7870..1543d461dcb 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js @@ -41,4 +41,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(delete sample.bar, false, 'The value of `delete sample.bar` is false'); assert.sameValue(delete sample.baz, true, 'The value of `delete sample.baz` is true'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict.js b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict.js index 2de09815ce6..368bef5444f 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict.js +++ b/test/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict.js @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }); assert.sameValue(delete sample.baz, true, 'The value of `delete sample.baz` is true'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/indexed-value.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/indexed-value.js index 362a9be9574..c005ae73dc0 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/indexed-value.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/indexed-value.js @@ -31,4 +31,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample["0"], 42n); assert.sameValue(sample["1"], 1n); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-canonical-index.js index bcfd5c1011f..864f5c2837c 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-canonical-index.js @@ -58,4 +58,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { delete TypedArray.prototype[key]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-integer.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-integer.js index 396533875cc..1aaa4345d0e 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-integer.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-integer.js @@ -34,4 +34,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var sample = new TA(makeCtorArg([42n, 43n])); assert.sameValue(sample["1.1"], undefined); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-minus-zero.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-minus-zero.js index 466774f6994..a23116f33a2 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-minus-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-minus-zero.js @@ -34,4 +34,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { var sample = new TA(makeCtorArg([42n, 43n])); assert.sameValue(sample["-0"], undefined); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index-get-throws.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index-get-throws.js index 1136d6550f3..caff8fe2cec 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index-get-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index-get-throws.js @@ -35,4 +35,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.test262; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index.js index 872d37bf805..a8bdc5c250c 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-not-numeric-index.js @@ -36,4 +36,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample.bar, "baz", "return value from get accessor"); assert.sameValue(sample.baz, "test262", "return value from inherited key"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-out-of-bounds.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-out-of-bounds.js index 2bc24b43537..4553ce6117d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-out-of-bounds.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-out-of-bounds.js @@ -40,4 +40,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample["-1"], undefined); assert.sameValue(sample["2"], undefined); assert.sameValue(sample["3"], undefined); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-symbol.js index e737b70f614..c01a93b6b35 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/BigInt/key-is-symbol.js @@ -37,4 +37,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample[s1], "bar", "return value from get accessor"); assert.sameValue(sample[parentKey], "test262", "value from parent key"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/indexed-value.js b/test/built-ins/TypedArrayConstructors/internals/Get/indexed-value.js index 02b16361028..cf2182d65c1 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/indexed-value.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/indexed-value.js @@ -31,4 +31,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample["0"], 42); assert.sameValue(sample["1"], 1); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.js index 9ab5556aed2..f6e37eeb748 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.js @@ -58,4 +58,4 @@ testWithTypedArrayConstructors(function(TA) { delete TypedArray.prototype[key]; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-integer.js b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-integer.js index ba0433d1553..34ab646140f 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-integer.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-integer.js @@ -34,4 +34,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { var sample = new TA(makeCtorArg([42, 43])); assert.sameValue(sample["1.1"], undefined); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.js b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.js index eaaf4c1bdd3..deaa7c7fd5d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.js @@ -34,4 +34,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { var sample = new TA(makeCtorArg([42, 43])); assert.sameValue(sample["-0"], undefined); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.js b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.js index 4aa642e3d05..3c13e9cc698 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.js @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample.test262; }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.js index 237e575d61f..3e42fc1b2db 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.js @@ -36,4 +36,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample.bar, "baz", "return value from get accessor"); assert.sameValue(sample.baz, "test262", "return value from inherited key"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.js b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.js index 929dd74a506..94296bc2d0c 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.js @@ -40,4 +40,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample["-1"], undefined); assert.sameValue(sample["2"], undefined); assert.sameValue(sample["3"], undefined); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-symbol.js index f78893eecbd..fb5ca9fe71f 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Get/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/Get/key-is-symbol.js @@ -37,4 +37,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample[s1], "bar", "return value from get accessor"); assert.sameValue(sample[parentKey], "test262", "value from parent key"); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/index-prop-desc.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/index-prop-desc.js index a8c91cec542..12a8dd1791e 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/index-prop-desc.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/index-prop-desc.js @@ -33,4 +33,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(descriptor1.configurable, true); assert.sameValue(descriptor1.enumerable, true); assert.sameValue(descriptor1.writable, true); -}); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-canonical-index.js index 710a2e5e777..a6cc555200a 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-canonical-index.js @@ -45,4 +45,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "return value from a ordinary property key [" + key + "]" ); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-numeric-index.js index 7471acdbff6..13b62d29eb0 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-not-numeric-index.js @@ -35,4 +35,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "bar", "return value from a String key" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-symbol.js index 48c9c6d4634..a2576b889f4 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/key-is-symbol.js @@ -28,4 +28,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "baz", "return value from a Symbol key" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/immutable-buffer.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/immutable-buffer.js new file mode 100644 index 00000000000..22fa6db0c2a --- /dev/null +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/immutable-buffer.js @@ -0,0 +1,43 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray-getownproperty +description: > + When the backing buffer is immutable, properties for in-bounds indexes are + associated with non-configurable non-writable descriptors. +info: | + [[GetOwnProperty]] ( P ) + 1. If P is a String, then + a. Let numericIndex be CanonicalNumericIndexString(P). + b. If numericIndex is not undefined, then + i. Let value be TypedArrayGetElement(O, numericIndex). + ii. If value is undefined, return undefined. + iii. Let mutable be true. + iv. If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, set mutable to false. + v. Return the PropertyDescriptor { [[Value]]: value, [[Writable]]: true mutable, + [[Enumerable]]: true, [[Configurable]]: true mutable }. +features: [TypedArray, immutable-arraybuffer] +includes: [testTypedArray.js, compareArray.js, propertyHelper.js] +---*/ + +testWithAllTypedArrayConstructors(function(TA, makeCtorArg) { + var sample = new TA(makeCtorArg(["42", "43"])); + + var value0 = sample[0]; + var value1 = sample[1]; + assert.compareArray([String(value0), String(value1)], ["42", "43"]); + + verifyProperty(sample, "0", { + value: value0, + configurable: false, + enumerable: true, + writable: false + }); + verifyProperty(sample, "1", { + value: value1, + configurable: false, + enumerable: true, + writable: false + }); +}, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js index c7f18eaa6f5..3cf85e0e2c5 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(descriptor1.configurable, true); assert.sameValue(descriptor1.enumerable, true); assert.sameValue(descriptor1.writable, true); -}); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.js index 1c9350f7839..50a54fe78c5 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.js @@ -45,4 +45,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "return value from a ordinary property key [" + key + "]" ); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.js index fd099e971ab..e8b3e558c83 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.js @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "bar", "return value from a String key" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.js index f679b72ed14..e7fde12785e 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.js @@ -28,4 +28,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "baz", "return value from a Symbol key" ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js index 72e5d24fbcd..2ec7da71262 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js @@ -60,4 +60,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { true, 'Reflect.has(sample, "foo") must return true' ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-canonical-index.js index 1ee2203b15c..b904ff88e05 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-canonical-index.js @@ -50,4 +50,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { "returns true with own key [" + key + "]" ); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-numeric-index.js index 741f172be07..94ae3ef5fd7 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-not-numeric-index.js @@ -26,4 +26,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { Object.defineProperty(sample, "foo", { value: 42 }); assert.sameValue(Reflect.has(sample, "foo"), true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-symbol.js index 491211881ef..bff742b7635 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/key-is-symbol.js @@ -25,4 +25,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { Object.defineProperty(sample, s, { value: 42 }); assert.sameValue(Reflect.has(sample, s), true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.js index ba7d3a38314..9e713f40a54 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.js @@ -60,4 +60,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { true, 'Reflect.has(sample, "foo") must return true' ); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.js index 5706f58e723..37ec90a34a4 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.js @@ -50,4 +50,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { "returns true with own key [" + key + "]" ); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.js index 3e331efa44f..c03442fb865 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.js @@ -26,4 +26,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { Object.defineProperty(sample, "foo", { value: 42 }); assert.sameValue(Reflect.has(sample, "foo"), true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-symbol.js index 184d21af832..4f5787eadac 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-symbol.js @@ -25,4 +25,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { Object.defineProperty(sample, s, { value: 42 }); assert.sameValue(Reflect.has(sample, s), true); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/not-enumerable-keys.js b/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/not-enumerable-keys.js index dc637aa66b2..37c3610c019 100644 --- a/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/not-enumerable-keys.js +++ b/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/BigInt/not-enumerable-keys.js @@ -32,4 +32,4 @@ testWithBigIntTypedArrayConstructors(function(TA) { }); var result = Reflect.ownKeys(sample); assert(compareArray(result, ["test262", s])); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.js b/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.js index a5b53472d80..ad030c21eea 100644 --- a/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.js +++ b/test/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.js @@ -32,4 +32,4 @@ testWithTypedArrayConstructors(function(TA) { }); var result = Reflect.ownKeys(sample); assert(compareArray(result, ["test262", s])); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/indexed-value.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/indexed-value.js index e789a91537b..32e42668c14 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/indexed-value.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/indexed-value.js @@ -35,4 +35,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample[0], 1n, 'The value of sample[0] is 1n'); assert.sameValue(Reflect.set(sample, '1', 42n), true, 'Reflect.set(sample, "1", 42n) must return true'); assert.sameValue(sample[1], 42n, 'The value of sample[1] is 42n'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-canonical-index.js index 0390b10b2ba..5f2406693c6 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-canonical-index.js @@ -46,4 +46,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(Reflect.set(sample, key, 42), false, 'Reflect.set("new TA(makeCtorArg([42n]))", key, 42) must return false'); assert.sameValue(sample[key], undefined, 'The value of sample[key] is expected to equal `undefined`'); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js index 4c228bc348a..b50dc322d77 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js @@ -37,4 +37,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { }); assert.sameValue(sample.test262, undefined, 'The value of sample.test262 is expected to equal `undefined`'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index.js index 94d4103641a..2fefaceb84b 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index.js @@ -42,4 +42,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(Reflect.set(sample, 'foo', 42), false, 'Reflect.set("new TA(makeCtorArg([42n]))", "foo", 42) must return false'); assert.sameValue(sample.foo, undefined, 'The value of sample.foo is expected to equal `undefined`'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-symbol.js index fe4775149d3..150dbac2585 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-symbol.js @@ -48,4 +48,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { ); assert.sameValue(sample[s2], undefined, 'The value of sample[s2] is expected to equal `undefined`'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js index 89e39ea4cdb..adac68e2078 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js @@ -81,5 +81,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(TypeError, function() { typedArray[0] = NaN; }); - -}); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/tonumber-value-throws.js b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/tonumber-value-throws.js index 17bcb4e8d7b..b4e87fbb01a 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/tonumber-value-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/tonumber-value-throws.js @@ -57,4 +57,4 @@ testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample['2'] = obj; }, '`sample["2"] = obj` throws Test262Error'); -}); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-non-strict.js new file mode 100644 index 00000000000..72197272360 --- /dev/null +++ b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-non-strict.js @@ -0,0 +1,94 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray-set +description: > + Rejects any attempt to set the value for a property whose name is a canonical + numeric index string when the backing buffer is immutable. +info: | + [[Set]] ( P, V, Receiver ) + 1. If P is a String, then + a. Let numericIndex be CanonicalNumericIndexString(P). + b. If numericIndex is not undefined, then + i. NOTE: TypedArray instances restrict own and inherited canonical numeric string properties to integer indices valid for their backing buffers, but assignment failures for canonical numeric string properties are only reported when the buffer is immutable. + ii. If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, return false. +features: [TypedArray, immutable-arraybuffer] +flags: [noStrict] +includes: [testTypedArray.js, compareArray.js] +---*/ + +function makeSpy(calls, label, value) { + return { + toString() { + calls.push(label + " toString"); + return value; + }, + valueOf() { + calls.push(label + " valueOf"); + return value; + } + }; +} + +function unloggedHasOwn(obj, key, calls) { + var length = calls.length; + var result = obj.hasOwnProperty(key); + calls.length = length; + return result; +} + +function repr(value) { + var t = typeof value; + if (value === null || t === "undefined") return String(value); + if (t === "object") return "object"; + if (isNegativeZero(value)) return "number -0"; + return t + " " + value; +} + +var hasReflectSet = typeof Reflect !== "undefined" && Reflect.set; + +testWithAllTypedArrayConstructors((TA, makeCtorArg) => { + var calls = []; + + var ta = new TA(makeCtorArg(["1", "2"])); + + var badEntries = [ + ["0", "1"], + [0, "1"], + [makeSpy(calls, "key", "0"), makeSpy(calls, "value", "0")], + ["1", ta[0]], + [1, ta[0]], + ["1", "0"], + [1, "0"], + ["10", "0"], + [10, "0"], + ["-0", "0"], + ["-1", "0"], + ["1.5", "0"], + ["590295810358705700000", "0"], + ["5e-324", "0"], + ["1.7976931348623157e+308", "0"], + ["Infinity", "0"], + ["NaN", "0"] + ]; + for (var i = 0; i < badEntries.length; i++) { + var key = badEntries[i][0]; + var value = badEntries[i][1]; + var hasKey = unloggedHasOwn(ta, key, calls); + var entryRepr = "[" + repr(key) + ", " + repr(value) + "]"; + var label = "canonical numeric index string entry " + entryRepr; + if (hasReflectSet) { + assert.sameValue(Reflect.set(ta, key, value), false, + "Reflect.set must return false for " + label); + } + ta[key] = value; + assert.sameValue(unloggedHasOwn(ta, key, calls), hasKey, + "Property must not be created for " + label); + } + + assert.compareArray(ta, new TA(["1", "2"]), "Contents must not change"); + + var expectCalls = hasReflectSet ? ["key toString", "key toString"] : ["key toString"]; + assert.compareArray(calls, expectCalls, "Recorded calls"); +}, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-prototype-chain-non-strict.js b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-prototype-chain-non-strict.js new file mode 100644 index 00000000000..21eb6d27502 --- /dev/null +++ b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-prototype-chain-non-strict.js @@ -0,0 +1,118 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray-set +description: > + Rejects any attempt to set the value for a property whose name is a canonical + numeric index string that reaches a TypedArray backed by an immutable buffer + in the prototype chain. +info: | + [[Set]] ( P, V, Receiver ) + 1. If P is a String, then + a. Let numericIndex be CanonicalNumericIndexString(P). + b. If numericIndex is not undefined, then + i. NOTE: TypedArray instances restrict own and inherited canonical numeric string properties to integer indices valid for their backing buffers, but assignment failures for canonical numeric string properties are only reported when the buffer is immutable. + ii. If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, return false. +features: [TypedArray, immutable-arraybuffer] +flags: [noStrict] +includes: [testTypedArray.js, compareArray.js] +---*/ + +function makeSpy(calls, label, value) { + return { + toString() { + calls.push(label + " toString"); + return value; + }, + valueOf() { + calls.push(label + " valueOf"); + return value; + } + }; +} + +function unloggedHasOwn(obj, key, calls) { + var length = calls.length; + var result = obj.hasOwnProperty(key); + calls.length = length; + return result; +} + +function repr(value) { + var t = typeof value; + if (value === null || t === "undefined") return String(value); + if (t === "object") return "object"; + if (isNegativeZero(value)) return "number -0"; + return t + " " + value; +} + +var hasReflectSet = typeof Reflect !== "undefined" && Reflect.set; + +testWithAllTypedArrayConstructors((TA, makeCtorArg) => { + var calls = []; + + var ta = new TA(makeCtorArg(["1", "2", "3"])); + var receiver = Object.create(ta, { "2": { writable: true }, "3": { writable: true } }); + + var badEntries = [ + ["0", "1"], + [0, "1"], + [makeSpy(calls, "key", "0"), makeSpy(calls, "value", "0")], + ["1", ta[0]], + [1, ta[0]], + ["1", "0"], + [1, "0"], + ["10", "0"], + [10, "0"], + ["-0", "0"], + ["-1", "0"], + ["1.5", "0"], + ["590295810358705700000", "0"], + ["5e-324", "0"], + ["1.7976931348623157e+308", "0"], + ["Infinity", "0"], + ["NaN", "0"] + ]; + for (var i = 0; i < badEntries.length; i++) { + var key = badEntries[i][0]; + var value = badEntries[i][1]; + var hasKey = unloggedHasOwn(ta, key, calls); + var entryRepr = "[" + repr(key) + ", " + repr(value) + "]"; + var label = "canonical numeric index string entry " + entryRepr; + if (hasReflectSet) { + assert.sameValue(Reflect.set(ta, key, value, receiver), false, + "Reflect.set must return false for " + label); + } + receiver[key] = value; + assert.sameValue(unloggedHasOwn(ta, key, calls), hasKey, + "Property must not be created on TypedArray for " + label); + assert.sameValue(unloggedHasOwn(receiver, key, calls), false, + "Property must not be created on receiver for " + label); + } + + var overrideEntries = [ + ["coercible", "0"], + ["non-coercible", "foo"] + ]; + for (var key = 2; key <= 3; key++) { + for (var i = 0; i < overrideEntries.length; i++) { + var label = overrideEntries[i][0]; + var value = overrideEntries[i][1]; + if (hasReflectSet) { + assert.sameValue(Reflect.set(receiver, key, value), true, + "Reflect.set must return true for setting overridden property to " + label); + assert.sameValue(receiver[key], value, + "Reflect.set must succeed for setting overridden property to " + label); + } + receiver[key] = value; + assert.sameValue(receiver[key], value, + "Assignment must succeed for setting overridden property to " + label); + } + } + + assert.compareArray(ta, new TA(["1", "2", "3"]), "Contents must not change"); + + var expectCalls = hasReflectSet ? ["key toString", "key toString"] : ["key toString"]; + assert.compareArray(calls, expectCalls, "Recorded calls"); +}, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-prototype-chain-strict.js b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-prototype-chain-strict.js new file mode 100644 index 00000000000..07ce50f286f --- /dev/null +++ b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-prototype-chain-strict.js @@ -0,0 +1,120 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray-set +description: > + Rejects any attempt to set the value for a property whose name is a canonical + numeric index string that reaches a TypedArray backed by an immutable buffer + in the prototype chain. +info: | + [[Set]] ( P, V, Receiver ) + 1. If P is a String, then + a. Let numericIndex be CanonicalNumericIndexString(P). + b. If numericIndex is not undefined, then + i. NOTE: TypedArray instances restrict own and inherited canonical numeric string properties to integer indices valid for their backing buffers, but assignment failures for canonical numeric string properties are only reported when the buffer is immutable. + ii. If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, return false. +features: [TypedArray, immutable-arraybuffer] +flags: [onlyStrict] +includes: [testTypedArray.js, compareArray.js] +---*/ + +function makeSpy(calls, label, value) { + return { + toString() { + calls.push(label + " toString"); + return value; + }, + valueOf() { + calls.push(label + " valueOf"); + return value; + } + }; +} + +function unloggedHasOwn(obj, key, calls) { + var length = calls.length; + var result = obj.hasOwnProperty(key); + calls.length = length; + return result; +} + +function repr(value) { + var t = typeof value; + if (value === null || t === "undefined") return String(value); + if (t === "object") return "object"; + if (isNegativeZero(value)) return "number -0"; + return t + " " + value; +} + +var hasReflectSet = typeof Reflect !== "undefined" && Reflect.set; + +testWithAllTypedArrayConstructors((TA, makeCtorArg) => { + var calls = []; + + var ta = new TA(makeCtorArg(["1", "2", "3"])); + var receiver = Object.create(ta, { "2": { writable: true }, "3": { writable: true } }); + + var badEntries = [ + ["0", "1"], + [0, "1"], + [makeSpy(calls, "key", "0"), makeSpy(calls, "value", "0")], + ["1", ta[0]], + [1, ta[0]], + ["1", "0"], + [1, "0"], + ["10", "0"], + [10, "0"], + ["-0", "0"], + ["-1", "0"], + ["1.5", "0"], + ["590295810358705700000", "0"], + ["5e-324", "0"], + ["1.7976931348623157e+308", "0"], + ["Infinity", "0"], + ["NaN", "0"] + ]; + for (var i = 0; i < badEntries.length; i++) { + var key = badEntries[i][0]; + var value = badEntries[i][1]; + var hasKey = unloggedHasOwn(ta, key, calls); + var entryRepr = "[" + repr(key) + ", " + repr(value) + "]"; + var label = "canonical numeric index string entry " + entryRepr; + if (hasReflectSet) { + assert.sameValue(Reflect.set(ta, key, value, receiver), false, + "Reflect.set must return false for " + label); + } + assert.throws(TypeError, function() { + receiver[key] = value; + }, "Assignment must throw for " + label); + assert.sameValue(unloggedHasOwn(ta, key, calls), hasKey, + "Property must not be created on TypedArray for " + label); + assert.sameValue(unloggedHasOwn(receiver, key, calls), false, + "Property must not be created on receiver for " + label); + } + + var overrideEntries = [ + ["coercible", "0"], + ["non-coercible", "foo"] + ]; + for (var key = 2; key <= 3; key++) { + for (var i = 0; i < overrideEntries.length; i++) { + var label = overrideEntries[i][0]; + var value = overrideEntries[i][1]; + if (hasReflectSet) { + assert.sameValue(Reflect.set(receiver, key, value), true, + "Reflect.set must return true for setting overridden property to " + label); + assert.sameValue(receiver[key], value, + "Reflect.set must succeed for setting overridden property to " + label); + } + receiver[key] = value; + assert.sameValue(receiver[key], value, + "Assignment must succeed for setting overridden property to " + label); + } + } + + assert.compareArray(ta, new TA(["1", "2", "3"]), "Contents must not change"); + + var expectCalls = hasReflectSet ? ["key toString", "key toString"] : ["key toString"]; + assert.compareArray(calls, expectCalls, "Recorded calls"); +}, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-strict.js b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-strict.js new file mode 100644 index 00000000000..316e63c71f1 --- /dev/null +++ b/test/built-ins/TypedArrayConstructors/internals/Set/immutable-buffer-key-is-canonical-strict.js @@ -0,0 +1,96 @@ +// Copyright (C) 2025 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray-set +description: > + Rejects any attempt to set the value for a property whose name is a canonical + numeric index string when the backing buffer is immutable. +info: | + [[Set]] ( P, V, Receiver ) + 1. If P is a String, then + a. Let numericIndex be CanonicalNumericIndexString(P). + b. If numericIndex is not undefined, then + i. NOTE: TypedArray instances restrict own and inherited canonical numeric string properties to integer indices valid for their backing buffers, but assignment failures for canonical numeric string properties are only reported when the buffer is immutable. + ii. If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, return false. +features: [TypedArray, immutable-arraybuffer] +flags: [onlyStrict] +includes: [testTypedArray.js, compareArray.js] +---*/ + +function makeSpy(calls, label, value) { + return { + toString() { + calls.push(label + " toString"); + return value; + }, + valueOf() { + calls.push(label + " valueOf"); + return value; + } + }; +} + +function unloggedHasOwn(obj, key, calls) { + var length = calls.length; + var result = obj.hasOwnProperty(key); + calls.length = length; + return result; +} + +function repr(value) { + var t = typeof value; + if (value === null || t === "undefined") return String(value); + if (t === "object") return "object"; + if (isNegativeZero(value)) return "number -0"; + return t + " " + value; +} + +var hasReflectSet = typeof Reflect !== "undefined" && Reflect.set; + +testWithAllTypedArrayConstructors((TA, makeCtorArg) => { + var calls = []; + + var ta = new TA(makeCtorArg(["1", "2"])); + + var badEntries = [ + ["0", "1"], + [0, "1"], + [makeSpy(calls, "key", "0"), makeSpy(calls, "value", "0")], + ["1", ta[0]], + [1, ta[0]], + ["1", "0"], + [1, "0"], + ["10", "0"], + [10, "0"], + ["-0", "0"], + ["-1", "0"], + ["1.5", "0"], + ["590295810358705700000", "0"], + ["5e-324", "0"], + ["1.7976931348623157e+308", "0"], + ["Infinity", "0"], + ["NaN", "0"] + ]; + for (var i = 0; i < badEntries.length; i++) { + var key = badEntries[i][0]; + var value = badEntries[i][1]; + var hasKey = unloggedHasOwn(ta, key, calls); + var entryRepr = "[" + repr(key) + ", " + repr(value) + "]"; + var label = "canonical numeric index string entry " + entryRepr; + if (hasReflectSet) { + assert.sameValue(Reflect.set(ta, key, value), false, + "Reflect.set must return false for " + label); + } + assert.throws(TypeError, function() { + ta[key] = value; + }, "Assignment must throw for " + label); + assert.sameValue(unloggedHasOwn(ta, key, calls), hasKey, + "Property must not be created for " + label); + } + + assert.compareArray(ta, new TA(["1", "2"]), "Contents must not change"); + + var expectCalls = hasReflectSet ? ["key toString", "key toString"] : ["key toString"]; + assert.compareArray(calls, expectCalls, "Recorded calls"); +}, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js b/test/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js index 10051e2743e..84c6214eea5 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js @@ -50,4 +50,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.sameValue(sample[0], 1, 'The value of sample[0] is 1'); assert.sameValue(Reflect.set(sample, '1', 42), true, 'Reflect.set(sample, "1", 42) must return true'); assert.sameValue(sample[1], 42, 'The value of sample[1] is 42'); -}, null, ["passthrough"]); +}, null, null, ["immutable"]); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js index 7795fbc7ae3..20766284de9 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js @@ -55,4 +55,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { sample[key], undefined, 'The value of sample[key] is expected to equal `undefined`' ); }); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js index bcd4082c799..a7db4ed29c8 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js @@ -37,4 +37,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { }); assert.sameValue(sample.test262, undefined, 'The value of sample.test262 is expected to equal `undefined`'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js index 9164a8bfbee..8cc9e8b2e17 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { 'Reflect.set(sample, "foo", 42) must return false' ); assert.sameValue(sample.foo, undefined, 'The value of sample.foo is expected to equal `undefined`'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js index e6207a8dc19..51eec310c97 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js @@ -45,4 +45,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { 'Reflect.set(sample, "Symbol(\\"2\\")", 42) must return false' ); assert.sameValue(sample[s2], undefined, 'The value of sample[s2] is expected to equal `undefined`'); -}, null, ["passthrough"]); +}); diff --git a/test/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js b/test/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js index beabcd95fcb..5f30b83f9c0 100644 --- a/test/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js +++ b/test/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js @@ -58,4 +58,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) { assert.throws(Test262Error, function() { sample["2"] = obj; }); -}); +}, null, null, ["immutable"]);