diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js index 1160cd9dd9..f5a7aed792 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js @@ -3,16 +3,31 @@ /*--- esid: sec-%typedarray%.prototype.slice description: > - Throws a TypeError if _O_.[[ViewedArrayBuffer]] is detached during Get custom constructor (other targetType) + Throws a TypeError if _O_.[[ViewedArrayBuffer]] is detached during create with custom constructor (other targetType) info: | - 22.2.3.24 %TypedArray%.prototype.slice ( start, end ) + %TypedArray%.prototype.slice ( start, end ) - ... - Let A be ? TypedArraySpeciesCreate(O, « count »). - If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... -includes: [testBigIntTypedArray.js, detachArrayBuffer.js] + Let A be ? TypedArraySpeciesCreate(O, « count »). + + TypedArraySpeciesCreate ( exemplar, argumentList ) + + Let result be ? TypedArrayCreate(constructor, argumentList). + + TypedArrayCreate ( constructor, argumentList ) + + Let newTypedArray be ? Construct(constructor, argumentList). + Perform ? ValidateTypedArray(newTypedArray). + + ValidateTypedArray ( O ) + The abstract operation ValidateTypedArray takes argument O. It performs the following steps when called: + + Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + Assert: O has a [[ViewedArrayBuffer]] internal slot. + Let buffer be O.[[ViewedArrayBuffer]]. + If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + ... + +includes: [testBigIntTypedArray.js, detachArrayBuffer.js, propertyHelper.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] ---*/ @@ -20,11 +35,35 @@ testWithBigIntTypedArrayConstructors(function(TA) { let counter = 0; var sample = new TA(1); + verifyConfigurable(sample, "0"); + Object.defineProperty(sample, "0", { + get() { + // If the slice operation reaches this code, + // then it did not throw a TypeError exception + // as a result of the detached buffer. + // + // Reaching this code is the equivalent to: + // + // If count > 0, then + // If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. + // Let srcName be the String value of O.[[TypedArrayName]]. + // Let srcType be the Element Type value in Table 62 for srcName. + // Let targetName be the String value of A.[[TypedArrayName]]. + // Let targetType be the Element Type value in Table 62 for targetName. + // If srcType is different from targetType, then + // Let n be 0. + // Repeat, while k < final, + // Let Pk be ! ToString(k). + // Let kValue be ! Get(O, Pk). + // + throw new Test262Error(); + } + }); + sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array; counter++; - assert.sameValue(count, 1, 'The value of `count` is 1'); $DETACHBUFFER(sample.buffer); return new other(count); }; diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js index ff357e9ca0..0cdea977d9 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-same-targettype.js @@ -3,15 +3,30 @@ /*--- esid: sec-%typedarray%.prototype.slice description: > - Throws a TypeError if _O_.[[ViewedArrayBuffer]] is detached during Get custom constructor. + Throws a TypeError if _O_.[[ViewedArrayBuffer]] is detached during create with custom constructor. info: | - 22.2.3.24 %TypedArray%.prototype.slice ( start, end ) + %TypedArray%.prototype.slice ( start, end ) + + Let A be ? TypedArraySpeciesCreate(O, « count »). + + TypedArraySpeciesCreate ( exemplar, argumentList ) + + Let result be ? TypedArrayCreate(constructor, argumentList). + + TypedArrayCreate ( constructor, argumentList ) + + Let newTypedArray be ? Construct(constructor, argumentList). + Perform ? ValidateTypedArray(newTypedArray). + + ValidateTypedArray ( O ) + The abstract operation ValidateTypedArray takes argument O. It performs the following steps when called: + + Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + Assert: O has a [[ViewedArrayBuffer]] internal slot. + Let buffer be O.[[ViewedArrayBuffer]]. + If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + ... - ... - Let A be ? TypedArraySpeciesCreate(O, « count »). - If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... includes: [testBigIntTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] ---*/ @@ -23,7 +38,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { counter++; - assert.sameValue(count, 1, 'The value of `count` is 1'); $DETACHBUFFER(sample.buffer); return new TA(count); }; diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js index ab5e65dc55..8c2d73e9e2 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-get-ctor.js @@ -2,15 +2,31 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-%typedarray%.prototype.slice -description: Throws a TypeError if _O_.[[ViewedArrayBuffer]] is detached. +description: > + Throws a TypeError if _O_.[[ViewedArrayBuffer]] is detached during Get custom constructor. info: | - 22.2.3.24 %TypedArray%.prototype.slice ( start, end ) + %TypedArray%.prototype.slice ( start, end ) + + Let A be ? TypedArraySpeciesCreate(O, « count »). + + TypedArraySpeciesCreate ( exemplar, argumentList ) + + Let result be ? TypedArrayCreate(constructor, argumentList). + + TypedArrayCreate ( constructor, argumentList ) + + Let newTypedArray be ? Construct(constructor, argumentList). + Perform ? ValidateTypedArray(newTypedArray). + + ValidateTypedArray ( O ) + The abstract operation ValidateTypedArray takes argument O. It performs the following steps when called: + + Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + Assert: O has a [[ViewedArrayBuffer]] internal slot. + Let buffer be O.[[ViewedArrayBuffer]]. + If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + ... - ... - Let A be ? TypedArraySpeciesCreate(O, « count »). - If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... includes: [testBigIntTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js index c182b4c408..1179fb1ff9 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-speciesctor-get-species-custom-ctor-throws.js @@ -4,13 +4,27 @@ esid: sec-%typedarray%.prototype.slice description: Throws a TypeError if buffer of object created by custom constructor is detached. info: | - 22.2.3.24 %TypedArray%.prototype.slice ( start, end ) + %TypedArray%.prototype.slice ( start, end ) - Let A be ? TypedArraySpeciesCreate(O, « count »). - If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... - Return A. + Let A be ? TypedArraySpeciesCreate(O, « count »). + + TypedArraySpeciesCreate ( exemplar, argumentList ) + + Let result be ? TypedArrayCreate(constructor, argumentList). + + TypedArrayCreate ( constructor, argumentList ) + + Let newTypedArray be ? Construct(constructor, argumentList). + Perform ? ValidateTypedArray(newTypedArray). + + ValidateTypedArray ( O ) + The abstract operation ValidateTypedArray takes argument O. It performs the following steps when called: + + Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + Assert: O has a [[ViewedArrayBuffer]] internal slot. + Let buffer be O.[[ViewedArrayBuffer]]. + If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + ... includes: [testBigIntTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] @@ -24,7 +38,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample.constructor[Symbol.species] = function(count) { let other = new TA(count); counter++; - assert.sameValue(count, 1, 'The value of `count` is 1'); $DETACHBUFFER(other.buffer); return other; }; diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js index 70ea823512..0cef4dd18d 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js @@ -10,8 +10,7 @@ info: | Let A be ? TypedArraySpeciesCreate(O, « count »). If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... + ... Return A includes: [testBigIntTypedArray.js, detachArrayBuffer.js] @@ -24,7 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { let ctor = {}; ctor[Symbol.species] = function(count) { counter++; - assert.sameValue(count, 0); Other = TA === BigInt64Array ? BigUint64Array : BigInt64Array; $DETACHBUFFER(sample.buffer); other = new Other(count); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js index 5feea0e79c..3f5424b14b 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-same-targettype.js @@ -10,8 +10,7 @@ info: | Let A be ? TypedArraySpeciesCreate(O, « count »). If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... + ... Return A includes: [testBigIntTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray] @@ -23,7 +22,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { let ctor = {}; ctor[Symbol.species] = function(count) { counter++; - assert.sameValue(count, 0, 'The value of `count` is 0'); $DETACHBUFFER(sample.buffer); other = new TA(count); return other; diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js index 2049d8d640..f65fdd605c 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js @@ -13,7 +13,7 @@ info: | If count > 0, then If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. ... -includes: [testTypedArray.js, detachArrayBuffer.js] +includes: [testTypedArray.js, detachArrayBuffer.js, propertyHelper.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] ---*/ @@ -21,11 +21,35 @@ testWithTypedArrayConstructors(function(TA) { let counter = 0; var sample = new TA(1); + verifyConfigurable(sample, "0"); + Object.defineProperty(sample, "0", { + get() { + // If the slice operation reaches this code, + // then it did not throw a TypeError exception + // as a result of the detached buffer. + // + // Reaching this code is the equivalent to: + // + // If count > 0, then + // If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. + // Let srcName be the String value of O.[[TypedArrayName]]. + // Let srcType be the Element Type value in Table 62 for srcName. + // Let targetName be the String value of A.[[TypedArrayName]]. + // Let targetType be the Element Type value in Table 62 for targetName. + // If srcType is different from targetType, then + // Let n be 0. + // Repeat, while k < final, + // Let Pk be ! ToString(k). + // Let kValue be ! Get(O, Pk). + // + throw new Test262Error(); + } + }); + sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { var other = TA === Int8Array ? Int16Array : Int8Array; counter++; - assert.sameValue(count, 1, 'The value of `count` is 1'); $DETACHBUFFER(sample.buffer); return new other(count); }; diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js index a4161d0cb4..1064996422 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js @@ -22,7 +22,6 @@ testWithTypedArrayConstructors(function(TA) { sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { counter++; - assert.sameValue(count, 1, 'The value of `count` is 1'); $DETACHBUFFER(sample.buffer); return new TA(count); }; diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js index 38ef39752e..13befe56f0 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js @@ -4,13 +4,27 @@ esid: sec-%typedarray%.prototype.slice description: Throws a TypeError if buffer of object created by custom constructor is detached. info: | - 22.2.3.24 %TypedArray%.prototype.slice ( start, end ) + %TypedArray%.prototype.slice ( start, end ) - Let A be ? TypedArraySpeciesCreate(O, « count »). - If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... - Return A. + Let A be ? TypedArraySpeciesCreate(O, « count »). + + TypedArraySpeciesCreate ( exemplar, argumentList ) + + Let result be ? TypedArrayCreate(constructor, argumentList). + + TypedArrayCreate ( constructor, argumentList ) + + Let newTypedArray be ? Construct(constructor, argumentList). + Perform ? ValidateTypedArray(newTypedArray). + + ValidateTypedArray ( O ) + The abstract operation ValidateTypedArray takes argument O. It performs the following steps when called: + + Perform ? RequireInternalSlot(O, [[TypedArrayName]]). + Assert: O has a [[ViewedArrayBuffer]] internal slot. + Let buffer be O.[[ViewedArrayBuffer]]. + If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + ... includes: [testTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray] @@ -24,7 +38,6 @@ testWithTypedArrayConstructors(function(TA) { sample.constructor[Symbol.species] = function(count) { let other = new TA(count); counter++; - assert.sameValue(count, 1, 'The value of `count` is 1'); $DETACHBUFFER(other.buffer); return other; }; diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js index 0dd83fe8c2..b3fe845616 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js @@ -10,8 +10,7 @@ info: | Let A be ? TypedArraySpeciesCreate(O, « count »). If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. - ... + ... Return A includes: [testTypedArray.js, detachArrayBuffer.js] @@ -24,7 +23,6 @@ testWithTypedArrayConstructors(function(TA) { let ctor = {}; ctor[Symbol.species] = function(count) { counter++; - assert.sameValue(count, 0); Other = TA === Int16Array ? Int8Array : Int16Array; $DETACHBUFFER(sample.buffer); other = new Other(count); diff --git a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js index 58bdcf316d..b4f26a44b4 100644 --- a/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js @@ -10,7 +10,6 @@ info: | Let A be ? TypedArraySpeciesCreate(O, « count »). If count > 0, then - If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception. ... Return A includes: [testTypedArray.js, detachArrayBuffer.js] @@ -23,7 +22,6 @@ testWithTypedArrayConstructors(function(TA) { let ctor = {}; ctor[Symbol.species] = function(count) { counter++; - assert.sameValue(count, 0); $DETACHBUFFER(sample.buffer); other = new TA(count); return other; diff --git a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js index a8be08df81..8bcfc04409 100644 --- a/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js +++ b/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js @@ -43,6 +43,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue( Reflect.defineProperty(sample, '0', desc), false, - 'Reflect.defineProperty( sample, "0", {value: 0n, configurable: true, enumerable: true, writable: true} ) must return false' + 'Reflect.defineProperty(sample, "0", {value: 0n, configurable: true, enumerable: true, writable: true} ) must return false' ); }); 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 66bf4b78fa..8f846f0e50 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 @@ -25,7 +25,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { configurable: true, enumerable: true, writable: true - }), true, 'Reflect.defineProperty("new TA([42n, 42n])", "0", {value: 8n, configurable: true, enumerable: true, writable: true}) must return true'); + }), true, 'Reflect.defineProperty(sample, "0", {value: 8n, configurable: true, enumerable: true, writable: true}) must return true'); assert.sameValue(sample[0], 8n, 'The value of sample[0] is 8n'); var desc = Object.getOwnPropertyDescriptor(sample, '0'); diff --git a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/enumerate-detached-buffer.js b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/enumerate-detached-buffer.js index 00b0e2f3af..84b2f7df93 100644 --- a/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/enumerate-detached-buffer.js +++ b/test/built-ins/TypedArrayConstructors/internals/GetOwnProperty/BigInt/enumerate-detached-buffer.js @@ -34,9 +34,9 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(42); $DETACHBUFFER(sample.buffer); - let count = 0; + let counter = 0; for (var key in sample) { - count++; + counter++; } - assert.sameValue(count, 0, 'The value of `count` is 0'); + assert.sameValue(counter, 0, 'The value of `counter` is 0'); }); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/infinity-with-detached-buffer.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/infinity-with-detached-buffer.js index b1e54bb1ee..8e7265318c 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/infinity-with-detached-buffer.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/infinity-with-detached-buffer.js @@ -25,22 +25,22 @@ includes: [testBigIntTypedArray.js, detachArrayBuffer.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - let count = 0; + let counter = 0; let n = { valueOf() { - count++; + counter++; return 9n; } }; - assert.sameValue(count, 0, 'The value of `count` is 0'); + assert.sameValue(counter, 0, 'The value of `counter` is 0'); let ta = new TA([n]); - assert.sameValue(count, 1, 'The value of `count` is 1'); + assert.sameValue(counter, 1, 'The value of `counter` is 1'); $DETACHBUFFER(ta.buffer); with (ta) { Infinity; - assert.sameValue(count, 1, 'The value of `count` is 1'); + assert.sameValue(counter, 1, 'The value of `counter` is 1'); } }); diff --git a/test/built-ins/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js b/test/built-ins/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js index 0fcbd89dd7..4c4a6ffd0d 100644 --- a/test/built-ins/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js +++ b/test/built-ins/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js @@ -27,24 +27,24 @@ features: [align-detached-buffer-semantics-with-web-reality, TypedArray] ---*/ testWithTypedArrayConstructors(function(TA) { - let count = 0; + let counter = 0; let n = { valueOf() { - count++; + counter++; return 9; } }; - assert.sameValue(count, 0, 'The value of `count` is 0'); + assert.sameValue(counter, 0, 'The value of `counter` is 0'); let ta = new TA([n]); - assert.sameValue(count, 1, 'The value of `count` is 1'); + assert.sameValue(counter, 1, 'The value of `counter` is 1'); $DETACHBUFFER(ta.buffer); with (ta) { Infinity; - assert.sameValue(count, 1, 'The value of `count` is 1'); + assert.sameValue(counter, 1, 'The value of `counter` is 1'); } });