IntegerIndexedElementSet should always indicate success. Ref: tc39/ecma262/pull/2210

This commit is contained in:
Rick Waldron 2020-11-25 10:55:30 -05:00
parent 73798cbc61
commit 96aff62fb2
66 changed files with 966 additions and 476 deletions

View File

@ -5,33 +5,43 @@ esid: sec-%typedarray%.prototype.fill
description: >
Fills all the elements with non numeric values values.
info: |
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
%TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
%TypedArray%.prototype.fill is a distinct function that implements the same
algorithm as Array.prototype.fill as defined in 22.1.3.6 except that the this
object's [[ArrayLength]] internal slot is accessed in place of performing a
[[Get]] of "length". The implementation of the algorithm may be optimized with
the knowledge that the this value is an object that has a fixed length and
whose integer indexed properties are not sparse. However, such optimization
must not introduce any observable changes in the specified behaviour of the
algorithm.
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If O.[[ContentType]] is BigInt, set value to ? ToBigInt(value).
Otherwise, set value to ? ToNumber(value).
Let relativeStart be ? ToIntegerOrInfinity(start).
If relativeStart is -Infinity, let k be 0.
Else if relativeStart < 0, let k be max(len + relativeStart, 0).
Else, let k be min(relativeStart, len).
If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end).
If relativeEnd is -Infinity, let final be 0.
Else if relativeEnd < 0, let final be max(len + relativeEnd, 0).
Else, let final be min(relativeEnd, len).
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
Repeat, while k < final,
Let Pk be ! ToString(F(k)).
Perform ! Set(O, Pk, value, true).
Set k to k + 1.
Return O.
...
IntegerIndexedElementSet ( O, index, value )
22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
7. Repeat, while k < final
a. Let Pk be ! ToString(k).
b. Perform ? Set(O, Pk, value, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]

View File

@ -5,33 +5,42 @@ esid: sec-%typedarray%.prototype.fill
description: >
Fills all the elements with non numeric values values.
info: |
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
%TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
%TypedArray%.prototype.fill is a distinct function that implements the same
algorithm as Array.prototype.fill as defined in 22.1.3.6 except that the this
object's [[ArrayLength]] internal slot is accessed in place of performing a
[[Get]] of "length". The implementation of the algorithm may be optimized with
the knowledge that the this value is an object that has a fixed length and
whose integer indexed properties are not sparse. However, such optimization
must not introduce any observable changes in the specified behaviour of the
algorithm.
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If O.[[ContentType]] is BigInt, set value to ? ToBigInt(value).
Otherwise, set value to ? ToNumber(value).
Let relativeStart be ? ToIntegerOrInfinity(start).
If relativeStart is -Infinity, let k be 0.
Else if relativeStart < 0, let k be max(len + relativeStart, 0).
Else, let k be min(relativeStart, len).
If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end).
If relativeEnd is -Infinity, let final be 0.
Else if relativeEnd < 0, let final be max(len + relativeEnd, 0).
Else, let final be min(relativeEnd, len).
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
Repeat, while k < final,
Let Pk be ! ToString(F(k)).
Perform ! Set(O, Pk, value, true).
Set k to k + 1.
Return O.
...
IntegerIndexedElementSet ( O, index, value )
22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
...
7. Repeat, while k < final
a. Let Pk be ! ToString(k).
b. Perform ? Set(O, Pk, value, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]

View File

@ -5,32 +5,43 @@ esid: sec-%typedarray%.prototype.fill
description: >
Throws a TypeError if value is a Symbol
info: |
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
%TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
%TypedArray%.prototype.fill is a distinct function that implements the same
algorithm as Array.prototype.fill as defined in 22.1.3.6 except that the this
object's [[ArrayLength]] internal slot is accessed in place of performing a
[[Get]] of "length". The implementation of the algorithm may be optimized with
the knowledge that the this value is an object that has a fixed length and
whose integer indexed properties are not sparse. However, such optimization
must not introduce any observable changes in the specified behaviour of the
algorithm.
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If O.[[ContentType]] is BigInt, set value to ? ToBigInt(value).
Otherwise, set value to ? ToNumber(value).
Let relativeStart be ? ToIntegerOrInfinity(start).
If relativeStart is -Infinity, let k be 0.
Else if relativeStart < 0, let k be max(len + relativeStart, 0).
Else, let k be min(relativeStart, len).
If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end).
If relativeEnd is -Infinity, let final be 0.
Else if relativeEnd < 0, let final be max(len + relativeEnd, 0).
Else, let final be min(relativeEnd, len).
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
Repeat, while k < final,
Let Pk be ! ToString(F(k)).
Perform ! Set(O, Pk, value, true).
Set k to k + 1.
Return O.
...
IntegerIndexedElementSet ( O, index, value )
22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
7. Repeat, while k < final
a. Let Pk be ! ToString(k).
b. Perform ? Set(O, Pk, value, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
includes: [testBigIntTypedArray.js]
features: [BigInt, Symbol, TypedArray]

View File

@ -5,32 +5,43 @@ esid: sec-%typedarray%.prototype.fill
description: >
Returns abrupt from value set
info: |
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
%TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
%TypedArray%.prototype.fill is a distinct function that implements the same
algorithm as Array.prototype.fill as defined in 22.1.3.6 except that the this
object's [[ArrayLength]] internal slot is accessed in place of performing a
[[Get]] of "length". The implementation of the algorithm may be optimized with
the knowledge that the this value is an object that has a fixed length and
whose integer indexed properties are not sparse. However, such optimization
must not introduce any observable changes in the specified behaviour of the
algorithm.
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If O.[[ContentType]] is BigInt, set value to ? ToBigInt(value).
Otherwise, set value to ? ToNumber(value).
Let relativeStart be ? ToIntegerOrInfinity(start).
If relativeStart is -Infinity, let k be 0.
Else if relativeStart < 0, let k be max(len + relativeStart, 0).
Else, let k be min(relativeStart, len).
If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end).
If relativeEnd is -Infinity, let final be 0.
Else if relativeEnd < 0, let final be max(len + relativeEnd, 0).
Else, let final be min(relativeEnd, len).
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
Repeat, while k < final,
Let Pk be ! ToString(F(k)).
Perform ! Set(O, Pk, value, true).
Set k to k + 1.
Return O.
...
IntegerIndexedElementSet ( O, index, value )
22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
7. Repeat, while k < final
a. Let Pk be ! ToString(k).
b. Perform ? Set(O, Pk, value, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]

View File

@ -5,32 +5,43 @@ esid: sec-%typedarray%.prototype.fill
description: >
Fills all the elements with non numeric values values.
info: |
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
%TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
%TypedArray%.prototype.fill is a distinct function that implements the same
algorithm as Array.prototype.fill as defined in 22.1.3.6 except that the this
object's [[ArrayLength]] internal slot is accessed in place of performing a
[[Get]] of "length". The implementation of the algorithm may be optimized with
the knowledge that the this value is an object that has a fixed length and
whose integer indexed properties are not sparse. However, such optimization
must not introduce any observable changes in the specified behaviour of the
algorithm.
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If O.[[ContentType]] is BigInt, set value to ? ToBigInt(value).
Otherwise, set value to ? ToNumber(value).
Let relativeStart be ? ToIntegerOrInfinity(start).
If relativeStart is -Infinity, let k be 0.
Else if relativeStart < 0, let k be max(len + relativeStart, 0).
Else, let k be min(relativeStart, len).
If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end).
If relativeEnd is -Infinity, let final be 0.
Else if relativeEnd < 0, let final be max(len + relativeEnd, 0).
Else, let final be min(relativeEnd, len).
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
Repeat, while k < final,
Let Pk be ! ToString(F(k)).
Perform ! Set(O, Pk, value, true).
Set k to k + 1.
Return O.
...
IntegerIndexedElementSet ( O, index, value )
22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
7. Repeat, while k < final
a. Let Pk be ! ToString(k).
b. Perform ? Set(O, Pk, value, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
includes: [testTypedArray.js]
features: [TypedArray]

View File

@ -5,32 +5,43 @@ esid: sec-%typedarray%.prototype.fill
description: >
Throws a TypeError if value is a Symbol
info: |
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
%TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
%TypedArray%.prototype.fill is a distinct function that implements the same
algorithm as Array.prototype.fill as defined in 22.1.3.6 except that the this
object's [[ArrayLength]] internal slot is accessed in place of performing a
[[Get]] of "length". The implementation of the algorithm may be optimized with
the knowledge that the this value is an object that has a fixed length and
whose integer indexed properties are not sparse. However, such optimization
must not introduce any observable changes in the specified behaviour of the
algorithm.
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If O.[[ContentType]] is BigInt, set value to ? ToBigInt(value).
Otherwise, set value to ? ToNumber(value).
Let relativeStart be ? ToIntegerOrInfinity(start).
If relativeStart is -Infinity, let k be 0.
Else if relativeStart < 0, let k be max(len + relativeStart, 0).
Else, let k be min(relativeStart, len).
If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end).
If relativeEnd is -Infinity, let final be 0.
Else if relativeEnd < 0, let final be max(len + relativeEnd, 0).
Else, let final be min(relativeEnd, len).
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
Repeat, while k < final,
Let Pk be ! ToString(F(k)).
Perform ! Set(O, Pk, value, true).
Set k to k + 1.
Return O.
...
IntegerIndexedElementSet ( O, index, value )
22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
7. Repeat, while k < final
a. Let Pk be ! ToString(k).
b. Perform ? Set(O, Pk, value, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
includes: [testTypedArray.js]
features: [Symbol, TypedArray]

View File

@ -5,32 +5,43 @@ esid: sec-%typedarray%.prototype.fill
description: >
Returns abrupt from value set
info: |
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
%TypedArray%.prototype.fill ( value [ , start [ , end ] ] )
%TypedArray%.prototype.fill is a distinct function that implements the same
algorithm as Array.prototype.fill as defined in 22.1.3.6 except that the this
object's [[ArrayLength]] internal slot is accessed in place of performing a
[[Get]] of "length". The implementation of the algorithm may be optimized with
the knowledge that the this value is an object that has a fixed length and
whose integer indexed properties are not sparse. However, such optimization
must not introduce any observable changes in the specified behaviour of the
algorithm.
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If O.[[ContentType]] is BigInt, set value to ? ToBigInt(value).
Otherwise, set value to ? ToNumber(value).
Let relativeStart be ? ToIntegerOrInfinity(start).
If relativeStart is -Infinity, let k be 0.
Else if relativeStart < 0, let k be max(len + relativeStart, 0).
Else, let k be min(relativeStart, len).
If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end).
If relativeEnd is -Infinity, let final be 0.
Else if relativeEnd < 0, let final be max(len + relativeEnd, 0).
Else, let final be min(relativeEnd, len).
If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
Repeat, while k < final,
Let Pk be ! ToString(F(k)).
Perform ! Set(O, Pk, value, true).
Set k to k + 1.
Return O.
...
IntegerIndexedElementSet ( O, index, value )
22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
7. Repeat, while k < final
a. Let Pk be ! ToString(k).
b. Perform ? Set(O, Pk, value, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
includes: [testTypedArray.js]
features: [TypedArray]

View File

@ -2,30 +2,36 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-%typedarray%.prototype.includes
description: Throws a TypeError if this has a detached buffer after index coercion
description: >
Does not throw a TypeError if this has a detached buffer after index coercion,
because ValidateTypedArray has already successfully completed.
info: |
22.2.3.14 %TypedArray%.prototype.includes ( searchElement [ , fromIndex ] )
This function is not generic. ValidateTypedArray is applied to the this value
prior to evaluating the algorithm. If its result is an abrupt completion that
exception is thrown instead of evaluating the algorithm.
The interpretation and use of the arguments of %TypedArray%.prototype.includes are the same as for Array.prototype.includes as defined in 22.1.3.13.
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
When the includes method is called with one or two arguments, the following steps are taken:
Let O be the this value.
Perform ? ValidateTypedArray(O).
Let len be O.[[ArrayLength]].
If len is 0, return false.
Let n be ? ToIntegerOrInfinity(fromIndex).
...
5. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
...
includes: [testTypedArray.js, detachArrayBuffer.js]
features: [TypedArray]
features: [align-detached-buffer-semantics-with-web-reality, TypedArray]
---*/
testWithTypedArrayConstructors(function(TA) {
var sample = new TA(10);
function detachAndReturnIndex(){
const sample = new TA(10);
let isDetached = false;
function valueOf(){
$DETACHBUFFER(sample.buffer);
isDetached = true;
return 0;
}
assert.throws(TypeError, function() {
sample.includes(0, {valueOf :detachAndReturnIndex});
});
assert.sameValue(sample.includes(0, {valueOf}), false);
assert.sameValue(isDetached, true);
});

View File

@ -12,11 +12,20 @@ info: |
d. Perform ? Set(A, Pk, mappedValue, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )

View File

@ -14,11 +14,20 @@ info: |
d. Perform ? Set(A, Pk, mappedValue, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )

View File

@ -22,17 +22,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, "Unordered").
// NOTE: type will be set to BigInt64 in this test
16. Return true.
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
SetValueInBuffer ( arrayBuffer, byteIndex, type, value, isTypedArray, order [ , isLittleEndian ] )
...

View File

@ -22,17 +22,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, "Unordered").
// NOTE: type will be set to BigUint64 in this test
16. Return true.
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
SetValueInBuffer ( arrayBuffer, byteIndex, type, value, isTypedArray, order [ , isLittleEndian ] )
...

View File

@ -22,14 +22,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )
Object, Apply the following steps:

View File

@ -22,14 +22,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )
Object, Apply the following steps:

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -25,15 +25,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )

View File

@ -22,14 +22,24 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )
...
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array",
let numValue be ? ToBigInt(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
ToBigInt ( argument )
Object, Apply the following steps:

View File

@ -17,11 +17,20 @@ info: |
c. Perform ? Set(O, Pk, kValue, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )

View File

@ -19,11 +19,20 @@ info: |
c. Perform ? Set(O, Pk, kValue, true).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )

View File

@ -25,16 +25,26 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
7.1.3 ToNumber ( argument )
ToNumber ( argument )
Object, Apply the following steps:

View File

@ -25,16 +25,26 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
7.1.3 ToNumber ( argument )
ToNumber ( argument )
Object, Apply the following steps:

View File

@ -25,16 +25,26 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
7.1.3 ToNumber ( argument )
ToNumber ( argument )
Object, Apply the following steps:

View File

@ -25,16 +25,26 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
7.1.3 ToNumber ( argument )
ToNumber ( argument )
Object, Apply the following steps:

View File

@ -25,16 +25,26 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
7.1.3 ToNumber ( argument )
ToNumber ( argument )
Object, Apply the following steps:

View File

@ -5,11 +5,23 @@ esid: sec-%typedarray%.from
description: >
Throws a TypeError if argument is a Symbol
info: |
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testBigIntTypedArray.js]
features: [BigInt, Symbol, TypedArray]
---*/

View File

@ -5,12 +5,20 @@ esid: sec-%typedarray%.from
description: >
Test NaN conversions
info: |
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )
includes: [testTypedArray.js]

View File

@ -5,11 +5,21 @@ esid: sec-%typedarray%.from
description: >
Throws a TypeError if argument is a Symbol
info: |
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testTypedArray.js]
features: [Symbol, TypedArray]
---*/

View File

@ -16,11 +16,23 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/

View File

@ -17,11 +17,20 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return false.
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, cross-realm, Reflect, TypedArray]

View File

@ -16,12 +16,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return false.
...
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
---*/

View File

@ -16,11 +16,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
16. Return true.
includes: [testBigIntTypedArray.js]
features: [BigInt, Reflect, TypedArray]
---*/

View File

@ -19,11 +19,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, numericIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
16. Return true.
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
---*/

View File

@ -18,11 +18,20 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )

View File

@ -16,11 +16,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testTypedArray.js]
features: [TypedArray]
---*/

View File

@ -17,12 +17,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return false.
...
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
includes: [testTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, cross-realm, Reflect, TypedArray]
---*/

View File

@ -16,12 +16,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return false.
...
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
includes: [testTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
---*/

View File

@ -16,11 +16,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, intIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
16. Return true.
includes: [testTypedArray.js]
features: [Reflect, TypedArray]
---*/

View File

@ -20,11 +20,21 @@ info: |
2. Return ? IntegerIndexedElementSet(O, numericIndex, value).
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
16. Return true.
includes: [testTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
---*/

View File

@ -12,7 +12,8 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )

View File

@ -11,14 +11,10 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
16. Return true.
includes: [testBigIntTypedArray.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
---*/

View File

@ -3,7 +3,7 @@
/*---
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Returns false if index is -0
Returns true, even if index is -0
info: |
[[Set]] ( P, V, Receiver)
@ -11,19 +11,14 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )
5. If arrayTypeName is "BigUint64Array" or "BigInt64Array", let numValue be ? ToBigInt(value).
...
10. If index = -0, return false.
includes: [testBigIntTypedArray.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n]);
assert.sameValue(Reflect.set(sample, '-0', 1n), false, 'Reflect.set("new TA([42n])", "-0", 1n) must return false');
assert.sameValue(Reflect.set(sample, '-0', 1n), true, 'Reflect.set("new TA([42n])", "-0", 1n) must return true');
assert.sameValue(sample.hasOwnProperty('-0'), false, 'sample.hasOwnProperty("-0") must return false');
});

View File

@ -3,7 +3,7 @@
/*---
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Returns false if index is not integer
Returns true, even if index is not CanonicalNumericIndexString
info: |
9.4.5.5 [[Set]] ( P, V, Receiver)
@ -11,25 +11,21 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
6. If IsInteger(index) is false, return false.
...
includes: [testBigIntTypedArray.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n]);
assert.sameValue(Reflect.set(sample, '1.1', 1n), false, 'Reflect.set("new TA([42n])", "1.1", 1n) must return false');
assert.sameValue(Reflect.set(sample, '1.1', 1n), true, 'Reflect.set("new TA([42n])", "1.1", 1n) must return true');
assert.sameValue(
Reflect.set(sample, '0.0001', 1n),
false,
'Reflect.set("new TA([42n])", "0.0001", 1n) must return false'
true,
'Reflect.set("new TA([42n])", "0.0001", 1n) must return true'
);
assert.sameValue(sample.hasOwnProperty('1.1'), false, 'sample.hasOwnProperty("1.1") must return false');

View File

@ -3,7 +3,7 @@
/*---
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Returns false if index is out of bounds
Returns true, even if index is out of bounds
info: |
9.4.5.5 [[Set]] ( P, V, Receiver)
@ -11,10 +11,11 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
9.4.5.11 IntegerIndexedElementSet ( O, index, value )
...
8. Let length be the value of O's [[ArrayLength]] internal slot.
@ -25,9 +26,9 @@ features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, Ty
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n]);
assert.sameValue(Reflect.set(sample, '-1', 1n), false, 'Reflect.set("new TA([42n])", "-1", 1n) must return false');
assert.sameValue(Reflect.set(sample, '1', 1n), false, 'Reflect.set("new TA([42n])", "1", 1n) must return false');
assert.sameValue(Reflect.set(sample, '2', 1n), false, 'Reflect.set("new TA([42n])", "2", 1n) must return false');
assert.sameValue(Reflect.set(sample, '-1', 1n), true, 'Reflect.set("new TA([42n])", "-1", 1n) must return false');
assert.sameValue(Reflect.set(sample, '1', 1n), true, 'Reflect.set("new TA([42n])", "1", 1n) must return false');
assert.sameValue(Reflect.set(sample, '2', 1n), true, 'Reflect.set("new TA([42n])", "2", 1n) must return false');
assert.sameValue(sample.hasOwnProperty('-1'), false, 'sample.hasOwnProperty("-1") must return false');
assert.sameValue(sample.hasOwnProperty('1'), false, 'sample.hasOwnProperty("1") must return false');
assert.sameValue(sample.hasOwnProperty('2'), false, 'sample.hasOwnProperty("2") must return false');

View File

@ -5,7 +5,8 @@
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Setting a typed array element to a value that, when converted to the typed
array element type, detaches the typed array's underlying buffer, should return false.
array element type, detaches the typed array's underlying buffer,
will always return true.
info: |
9.4.5.5 [[Set]] ( P, V, Receiver)
@ -13,31 +14,25 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
Assert: Type(index) is Number.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return false.
includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
let ta = new TA(1);
let isDetached = false;
let result = Reflect.set(ta, 0, {
valueOf() {
$DETACHBUFFER(ta.buffer);
isDetached = true;
return 42n;
}
});
assert.sameValue(result, false);
assert.sameValue(result, true);
assert.sameValue(ta[0], undefined);
assert.sameValue(isDetached, true);
});

View File

@ -11,7 +11,8 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )

View File

@ -15,15 +15,24 @@ info: |
2. If Type(P) is String, then
...
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
#sec-integerindexedelementset
IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
#sec-setvalueinbuffer
SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,

View File

@ -12,14 +12,24 @@ info: |
2. If Type(P) is String, then
...
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )

View File

@ -12,7 +12,8 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )

View File

@ -11,14 +11,25 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).
16. Return true.
includes: [testTypedArray.js]
features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
---*/

View File

@ -3,7 +3,7 @@
/*---
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Returns false if index is -0
Returns true, even if index is -0
info: |
9.4.5.5 [[Set]] ( P, V, Receiver)
@ -11,14 +11,10 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
7. If index = -0, return false.
...
includes: [testTypedArray.js]
features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
---*/
@ -26,6 +22,6 @@ features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray
testWithTypedArrayConstructors(function(TA) {
var sample = new TA([42]);
assert.sameValue(Reflect.set(sample, "-0", 1), false, 'Reflect.set(sample, "-0", 1) must return false');
assert.sameValue(Reflect.set(sample, "-0", 1), true, 'Reflect.set(sample, "-0", 1) must return true');
assert.sameValue(sample.hasOwnProperty("-0"), false, 'sample.hasOwnProperty("-0") must return false');
});

View File

@ -3,7 +3,7 @@
/*---
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Returns false if index is not integer
Returns true, even if index is not CanonicalNumericIndexString
info: |
9.4.5.5 [[Set]] ( P, V, Receiver)
@ -11,14 +11,10 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
6. If IsInteger(index) is false, return false.
...
includes: [testTypedArray.js]
features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
---*/
@ -26,8 +22,8 @@ features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray
testWithTypedArrayConstructors(function(TA) {
var sample = new TA([42]);
assert.sameValue(Reflect.set(sample, "1.1", 1), false, 'Reflect.set(sample, "1.1", 1) must return false');
assert.sameValue(Reflect.set(sample, "0.0001", 1), false, 'Reflect.set(sample, "0.0001", 1) must return false');
assert.sameValue(Reflect.set(sample, "1.1", 1), true, 'Reflect.set(sample, "1.1", 1) must return true');
assert.sameValue(Reflect.set(sample, "0.0001", 1), true, 'Reflect.set(sample, "0.0001", 1) must return true');
assert.sameValue(sample.hasOwnProperty("1.1"), false, 'sample.hasOwnProperty("1.1") must return false');
assert.sameValue(

View File

@ -3,7 +3,7 @@
/*---
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Returns false if index is out of bounds
Returns true even if index is out of bounds
info: |
9.4.5.5 [[Set]] ( P, V, Receiver)
@ -11,15 +11,10 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
...
8. Let length be the value of O's [[ArrayLength]] internal slot.
9. If index < 0 or index length, return false.
...
includes: [testTypedArray.js]
features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
---*/
@ -27,9 +22,9 @@ features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray
testWithTypedArrayConstructors(function(TA) {
var sample = new TA([42]);
assert.sameValue(Reflect.set(sample, "-1", 1), false, 'Reflect.set(sample, "-1", 1) must return false');
assert.sameValue(Reflect.set(sample, "1", 1), false, 'Reflect.set(sample, "1", 1) must return false');
assert.sameValue(Reflect.set(sample, "2", 1), false, 'Reflect.set(sample, "2", 1) must return false');
assert.sameValue(Reflect.set(sample, "-1", 1), true, 'Reflect.set(sample, "-1", 1) must return true');
assert.sameValue(Reflect.set(sample, "1", 1), true, 'Reflect.set(sample, "1", 1) must return true');
assert.sameValue(Reflect.set(sample, "2", 1), true, 'Reflect.set(sample, "2", 1) must return true');
assert.sameValue(sample.hasOwnProperty("-1"), false, 'sample.hasOwnProperty("-1") must return false');
assert.sameValue(sample.hasOwnProperty("1"), false, 'sample.hasOwnProperty("1") must return false');

View File

@ -5,7 +5,7 @@
esid: sec-integer-indexed-exotic-objects-set-p-v-receiver
description: >
Setting a typed array element to a value that, when converted to the typed
array element type, detaches the typed array's underlying buffer, should return false.
array element type, detaches the typed array's underlying buffer, will return true.
info: |
9.4.5.5 [[Set]] ( P, V, Receiver)
@ -13,17 +13,24 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
9.4.5.11 IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
Assert: Type(index) is Number.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return false.
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
includes: [testTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, Reflect, TypedArray]
@ -38,6 +45,6 @@ testWithTypedArrayConstructors(function(TA) {
}
});
assert.sameValue(result, false);
assert.sameValue(result, true);
assert.sameValue(ta[0], undefined);
});

View File

@ -11,7 +11,8 @@ info: |
2. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
IntegerIndexedElementSet ( O, index, value )

View File

@ -5,11 +5,21 @@ esid: sec-%typedarray%.of
description: >
Throws a TypeError if argument is a Symbol
info: |
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testBigIntTypedArray.js]
features: [BigInt, Symbol, TypedArray]
---*/

View File

@ -11,14 +11,25 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/

View File

@ -5,11 +5,21 @@ esid: sec-%typedarray%.of
description: >
Throws a TypeError if argument is a Symbol
info: |
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testTypedArray.js]
features: [Symbol, TypedArray]
---*/

View File

@ -5,11 +5,20 @@ esid: sec-%typedarray%.of
description: >
Test NaN conversions
info: |
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
...
3. Let numValue be ? ToNumber(value).
...
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value [ ,
isLittleEndian ] )

View File

@ -11,14 +11,25 @@ info: |
2. If Type(P) is String and if SameValue(O, Receiver) is true, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Return ? IntegerIndexedElementSet(O, numericIndex, V).
i. Perform ? IntegerIndexedElementSet(O, numericIndex, V).
ii. Return true.
...
9.4.5.9 IntegerIndexedElementSet ( O, index, value )
IntegerIndexedElementSet ( O, index, value )
Assert: O is an Integer-Indexed exotic object.
If O.[[ContentType]] is BigInt, let numValue be ? ToBigInt(value).
Otherwise, let numValue be ? ToNumber(value).
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is false and ! IsValidIntegerIndex(O, index) is true, then
Let offset be O.[[ByteOffset]].
Let arrayTypeName be the String value of O.[[TypedArrayName]].
Let elementSize be the Element Size value specified in Table 62 for arrayTypeName.
Let indexedPosition be ((index) × elementSize) + offset.
Let elementType be the Element Type value in Table 62 for arrayTypeName.
Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue, true, Unordered).
Return NormalCompletion(undefined).
...
3. Let numValue be ? ToNumber(value).
...
includes: [testTypedArray.js]
features: [TypedArray]
---*/