Align detached buffer semantics with web reality, R2

This commit is contained in:
Rick Waldron 2020-10-19 17:29:14 -04:00
parent 6d49a317ac
commit 7d998a098e
5 changed files with 33 additions and 18 deletions

View File

@ -22,7 +22,7 @@ info: |
... ...
Let buffer be O.[[ViewedArrayBuffer]]. Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return false. If IsDetachedBuffer(buffer) is true, return false.
...
includes: [testBigIntTypedArray.js, detachArrayBuffer.js] includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, cross-realm, Reflect, TypedArray] features: [align-detached-buffer-semantics-with-web-reality, BigInt, cross-realm, Reflect, TypedArray]
---*/ ---*/

View File

@ -3,7 +3,7 @@
/*--- /*---
esid: sec-integer-indexed-exotic-objects-defineownproperty-p-desc esid: sec-integer-indexed-exotic-objects-defineownproperty-p-desc
description: > description: >
Returns false if key is a numeric index and Desc.[[Configurable]] is true Returns true if key is a numeric index and Desc.[[Configurable]] is true
info: | info: |
9.4.5.3 [[DefineOwnProperty]] ( P, Desc) 9.4.5.3 [[DefineOwnProperty]] ( P, Desc)
... ...
@ -11,8 +11,12 @@ info: |
a. Let numericIndex be ! CanonicalNumericIndexString(P). a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then b. If numericIndex is not undefined, then
... ...
viii. If Desc has a [[Configurable]] field and if Desc.[[Configurable]] is If Desc has a [[Configurable]] field and if Desc.[[Configurable]] is false, return false.
true, return false. ...
If Desc has a [[Value]] field, then
Let value be Desc.[[Value]].
Return ? IntegerIndexedElementSet(O, numericIndex, value).
... ...
includes: [testBigIntTypedArray.js] includes: [testBigIntTypedArray.js]
features: [BigInt, Reflect, TypedArray] features: [BigInt, Reflect, TypedArray]
@ -28,8 +32,8 @@ testWithBigIntTypedArrayConstructors(function(TA) {
enumerable: true, enumerable: true,
writable: true writable: true
}), }),
false, true,
"defineProperty's result" "defineProperty's result"
); );
assert.sameValue(sample[0], 0n, "side effect check"); assert.sameValue(sample[0], 42n, "side effect check");
}); });

View File

@ -11,8 +11,10 @@ info: |
a. Let numericIndex be ! CanonicalNumericIndexString(P). a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then b. If numericIndex is not undefined, then
... ...
v. If Desc has a [[Writable]] field and if Desc.[[Writable]] is false, If Desc has a [[Value]] field, then
return false. Let value be Desc.[[Value]].
Return ? IntegerIndexedElementSet(O, numericIndex, value).
... ...
includes: [testBigIntTypedArray.js, propertyHelper.js] includes: [testBigIntTypedArray.js, propertyHelper.js]
features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
@ -30,7 +32,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
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');
assert.sameValue(desc.value, 8n, 'The value of desc.value is 8n'); assert.sameValue(desc.value, 8n, 'The value of desc.value is 8n');
assert.sameValue(desc.configurable, true, 'The value of desc.configurable is true');
assert.sameValue(desc.enumerable, true, 'The value of desc.enumerable is true');
assert.sameValue(desc.writable, true, 'The value of desc.writable is true'); assert.sameValue(desc.writable, true, 'The value of desc.writable is true');
verifyEnumerable(sample, '0');
verifyNotConfigurable(sample, '0');
}); });

View File

@ -3,7 +3,7 @@
/*--- /*---
esid: sec-integer-indexed-exotic-objects-defineownproperty-p-desc esid: sec-integer-indexed-exotic-objects-defineownproperty-p-desc
description: > description: >
Returns false if key is a numeric index and Desc.[[Configurable]] is true Returns true if key is a numeric index and Desc.[[Configurable]] is true
info: | info: |
9.4.5.3 [[DefineOwnProperty]] ( P, Desc) 9.4.5.3 [[DefineOwnProperty]] ( P, Desc)
... ...
@ -11,8 +11,12 @@ info: |
a. Let numericIndex be ! CanonicalNumericIndexString(P). a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then b. If numericIndex is not undefined, then
... ...
viii. If Desc has a [[Configurable]] field and if Desc.[[Configurable]] is If Desc has a [[Configurable]] field and if Desc.[[Configurable]] is
true, return false. true, return false.
...
If Desc has a [[Value]] field, then
Let value be Desc.[[Value]].
Return ? IntegerIndexedElementSet(O, numericIndex, value).
... ...
includes: [testTypedArray.js] includes: [testTypedArray.js]
features: [Reflect, TypedArray] features: [Reflect, TypedArray]
@ -28,7 +32,7 @@ testWithTypedArrayConstructors(function(TA) {
enumerable: true, enumerable: true,
writable: true writable: true
}), }),
false, true,
"defineProperty's result" "defineProperty's result"
); );
assert.sameValue(sample[0], 0, "side effect check"); assert.sameValue(sample[0], 0, "side effect check");

View File

@ -10,10 +10,15 @@ info: |
3. If Type(P) is String, then 3. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P). a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then b. If numericIndex is not undefined, then
... If ! IsValidIntegerIndex(O, numericIndex) is false, return false.
x. If Desc has a [[Writable]] field and if Desc.[[Writable]] is false, If IsAccessorDescriptor(Desc) is true, return false.
return false. If Desc has a [[Configurable]] field and if Desc.[[Configurable]] is false, return false.
... If Desc has an [[Enumerable]] field and if Desc.[[Enumerable]] is false, return false.
If Desc has a [[Writable]] field and if Desc.[[Writable]] is false, return false.
If Desc has a [[Value]] field, then
Let value be Desc.[[Value]].
Return ? IntegerIndexedElementSet(O, numericIndex, value).
includes: [testTypedArray.js, propertyHelper.js] includes: [testTypedArray.js, propertyHelper.js]
features: [Reflect, TypedArray] features: [Reflect, TypedArray]
---*/ ---*/
@ -24,7 +29,7 @@ testWithTypedArrayConstructors(function(TA) {
assert.sameValue( assert.sameValue(
Reflect.defineProperty(sample, "0", { Reflect.defineProperty(sample, "0", {
value: 8, value: 8,
configurable: false, configurable: true,
enumerable: true, enumerable: true,
writable: true writable: true
}), }),