mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 15:34:29 +02:00
Cleanups
This commit is contained in:
parent
bf900a30b2
commit
59463a2dd7
@ -3,16 +3,31 @@
|
|||||||
/*---
|
/*---
|
||||||
esid: sec-%typedarray%.prototype.slice
|
esid: sec-%typedarray%.prototype.slice
|
||||||
description: >
|
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: |
|
info: |
|
||||||
22.2.3.24 %TypedArray%.prototype.slice ( start, end )
|
%TypedArray%.prototype.slice ( start, end )
|
||||||
|
|
||||||
...
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
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]
|
|
||||||
|
includes: [testBigIntTypedArray.js, detachArrayBuffer.js, propertyHelper.js]
|
||||||
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray]
|
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -20,11 +35,35 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
let counter = 0;
|
let counter = 0;
|
||||||
var sample = new TA(1);
|
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 = {};
|
||||||
sample.constructor[Symbol.species] = function(count) {
|
sample.constructor[Symbol.species] = function(count) {
|
||||||
var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
|
var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
return new other(count);
|
return new other(count);
|
||||||
};
|
};
|
||||||
|
@ -3,15 +3,30 @@
|
|||||||
/*---
|
/*---
|
||||||
esid: sec-%typedarray%.prototype.slice
|
esid: sec-%typedarray%.prototype.slice
|
||||||
description: >
|
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: |
|
info: |
|
||||||
22.2.3.24 %TypedArray%.prototype.slice ( start, end )
|
%TypedArray%.prototype.slice ( start, end )
|
||||||
|
|
||||||
...
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
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]
|
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
|
||||||
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray]
|
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray]
|
||||||
---*/
|
---*/
|
||||||
@ -23,7 +38,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
sample.constructor = {};
|
sample.constructor = {};
|
||||||
sample.constructor[Symbol.species] = function(count) {
|
sample.constructor[Symbol.species] = function(count) {
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
return new TA(count);
|
return new TA(count);
|
||||||
};
|
};
|
||||||
|
@ -2,15 +2,31 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-%typedarray%.prototype.slice
|
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: |
|
info: |
|
||||||
22.2.3.24 %TypedArray%.prototype.slice ( start, end )
|
%TypedArray%.prototype.slice ( start, end )
|
||||||
|
|
||||||
...
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
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]
|
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
|
||||||
features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray]
|
features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray]
|
||||||
---*/
|
---*/
|
||||||
|
@ -4,13 +4,27 @@
|
|||||||
esid: sec-%typedarray%.prototype.slice
|
esid: sec-%typedarray%.prototype.slice
|
||||||
description: Throws a TypeError if buffer of object created by custom constructor is detached.
|
description: Throws a TypeError if buffer of object created by custom constructor is detached.
|
||||||
info: |
|
info: |
|
||||||
22.2.3.24 %TypedArray%.prototype.slice ( start, end )
|
%TypedArray%.prototype.slice ( start, end )
|
||||||
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
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.
|
||||||
...
|
...
|
||||||
Return A.
|
|
||||||
|
|
||||||
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
|
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
|
||||||
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Symbol.species, TypedArray]
|
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) {
|
sample.constructor[Symbol.species] = function(count) {
|
||||||
let other = new TA(count);
|
let other = new TA(count);
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
|
||||||
$DETACHBUFFER(other.buffer);
|
$DETACHBUFFER(other.buffer);
|
||||||
return other;
|
return other;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,6 @@ info: |
|
|||||||
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
If count > 0, then
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
|
||||||
...
|
...
|
||||||
Return A
|
Return A
|
||||||
|
|
||||||
@ -24,7 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
let ctor = {};
|
let ctor = {};
|
||||||
ctor[Symbol.species] = function(count) {
|
ctor[Symbol.species] = function(count) {
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 0);
|
|
||||||
Other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
|
Other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
other = new Other(count);
|
other = new Other(count);
|
||||||
|
@ -10,7 +10,6 @@ info: |
|
|||||||
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
If count > 0, then
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
|
||||||
...
|
...
|
||||||
Return A
|
Return A
|
||||||
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
|
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
|
||||||
@ -23,7 +22,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
let ctor = {};
|
let ctor = {};
|
||||||
ctor[Symbol.species] = function(count) {
|
ctor[Symbol.species] = function(count) {
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 0, 'The value of `count` is 0');
|
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
other = new TA(count);
|
other = new TA(count);
|
||||||
return other;
|
return other;
|
||||||
|
@ -13,7 +13,7 @@ info: |
|
|||||||
If count > 0, then
|
If count > 0, then
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
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]
|
features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -21,11 +21,35 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
let counter = 0;
|
let counter = 0;
|
||||||
var sample = new TA(1);
|
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 = {};
|
||||||
sample.constructor[Symbol.species] = function(count) {
|
sample.constructor[Symbol.species] = function(count) {
|
||||||
var other = TA === Int8Array ? Int16Array : Int8Array;
|
var other = TA === Int8Array ? Int16Array : Int8Array;
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
return new other(count);
|
return new other(count);
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,6 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
sample.constructor = {};
|
sample.constructor = {};
|
||||||
sample.constructor[Symbol.species] = function(count) {
|
sample.constructor[Symbol.species] = function(count) {
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
return new TA(count);
|
return new TA(count);
|
||||||
};
|
};
|
||||||
|
@ -4,13 +4,27 @@
|
|||||||
esid: sec-%typedarray%.prototype.slice
|
esid: sec-%typedarray%.prototype.slice
|
||||||
description: Throws a TypeError if buffer of object created by custom constructor is detached.
|
description: Throws a TypeError if buffer of object created by custom constructor is detached.
|
||||||
info: |
|
info: |
|
||||||
22.2.3.24 %TypedArray%.prototype.slice ( start, end )
|
%TypedArray%.prototype.slice ( start, end )
|
||||||
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
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.
|
||||||
...
|
...
|
||||||
Return A.
|
|
||||||
|
|
||||||
includes: [testTypedArray.js, detachArrayBuffer.js]
|
includes: [testTypedArray.js, detachArrayBuffer.js]
|
||||||
features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray]
|
features: [align-detached-buffer-semantics-with-web-reality, Symbol.species, TypedArray]
|
||||||
@ -24,7 +38,6 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
sample.constructor[Symbol.species] = function(count) {
|
sample.constructor[Symbol.species] = function(count) {
|
||||||
let other = new TA(count);
|
let other = new TA(count);
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
|
||||||
$DETACHBUFFER(other.buffer);
|
$DETACHBUFFER(other.buffer);
|
||||||
return other;
|
return other;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,6 @@ info: |
|
|||||||
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
If count > 0, then
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
|
||||||
...
|
...
|
||||||
Return A
|
Return A
|
||||||
|
|
||||||
@ -24,7 +23,6 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
let ctor = {};
|
let ctor = {};
|
||||||
ctor[Symbol.species] = function(count) {
|
ctor[Symbol.species] = function(count) {
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 0);
|
|
||||||
Other = TA === Int16Array ? Int8Array : Int16Array;
|
Other = TA === Int16Array ? Int8Array : Int16Array;
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
other = new Other(count);
|
other = new Other(count);
|
||||||
|
@ -10,7 +10,6 @@ info: |
|
|||||||
|
|
||||||
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
Let A be ? TypedArraySpeciesCreate(O, « count »).
|
||||||
If count > 0, then
|
If count > 0, then
|
||||||
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
|
|
||||||
...
|
...
|
||||||
Return A
|
Return A
|
||||||
includes: [testTypedArray.js, detachArrayBuffer.js]
|
includes: [testTypedArray.js, detachArrayBuffer.js]
|
||||||
@ -23,7 +22,6 @@ testWithTypedArrayConstructors(function(TA) {
|
|||||||
let ctor = {};
|
let ctor = {};
|
||||||
ctor[Symbol.species] = function(count) {
|
ctor[Symbol.species] = function(count) {
|
||||||
counter++;
|
counter++;
|
||||||
assert.sameValue(count, 0);
|
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
other = new TA(count);
|
other = new TA(count);
|
||||||
return other;
|
return other;
|
||||||
|
@ -25,7 +25,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
configurable: true,
|
configurable: true,
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
writable: 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');
|
assert.sameValue(sample[0], 8n, 'The value of sample[0] is 8n');
|
||||||
var desc = Object.getOwnPropertyDescriptor(sample, '0');
|
var desc = Object.getOwnPropertyDescriptor(sample, '0');
|
||||||
|
@ -34,9 +34,9 @@ testWithBigIntTypedArrayConstructors(function(TA) {
|
|||||||
var sample = new TA(42);
|
var sample = new TA(42);
|
||||||
$DETACHBUFFER(sample.buffer);
|
$DETACHBUFFER(sample.buffer);
|
||||||
|
|
||||||
let count = 0;
|
let counter = 0;
|
||||||
for (var key in sample) {
|
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');
|
||||||
});
|
});
|
||||||
|
@ -25,22 +25,22 @@ includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
|
|||||||
features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray]
|
features: [align-detached-buffer-semantics-with-web-reality, BigInt, TypedArray]
|
||||||
---*/
|
---*/
|
||||||
testWithBigIntTypedArrayConstructors(function(TA) {
|
testWithBigIntTypedArrayConstructors(function(TA) {
|
||||||
let count = 0;
|
let counter = 0;
|
||||||
|
|
||||||
let n = {
|
let n = {
|
||||||
valueOf() {
|
valueOf() {
|
||||||
count++;
|
counter++;
|
||||||
return 9n;
|
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]);
|
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);
|
$DETACHBUFFER(ta.buffer);
|
||||||
|
|
||||||
with (ta) {
|
with (ta) {
|
||||||
Infinity;
|
Infinity;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
assert.sameValue(counter, 1, 'The value of `counter` is 1');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -27,24 +27,24 @@ features: [align-detached-buffer-semantics-with-web-reality, TypedArray]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
let count = 0;
|
let counter = 0;
|
||||||
let n = {
|
let n = {
|
||||||
valueOf() {
|
valueOf() {
|
||||||
count++;
|
counter++;
|
||||||
return 9;
|
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]);
|
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);
|
$DETACHBUFFER(ta.buffer);
|
||||||
|
|
||||||
with (ta) {
|
with (ta) {
|
||||||
Infinity;
|
Infinity;
|
||||||
assert.sameValue(count, 1, 'The value of `count` is 1');
|
assert.sameValue(counter, 1, 'The value of `counter` is 1');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user