Atomics: fix test info contents to match definition as it appears in ES2020. Fixes gh-2721

This commit is contained in:
Rick Waldron 2020-08-20 14:43:38 -04:00
parent e8cdf923ef
commit 1c22e0b2f2
2 changed files with 23 additions and 11 deletions

View File

@ -3,15 +3,21 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
A null value for bufferData throws a TypeError A null value for bufferData (detached) throws a TypeError
info: | info: |
Atomics.notify( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). Let buffer be ? ValidateIntegerTypedArray(typedArray, true).
...
Let buffer be ? ValidateTypedArray(typedArray).
... ...
9.If IsSharedArrayBuffer(buffer) is false, throw a TypeError exception.
... If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
3.If bufferData is null, return false. ...
If arrayBuffer.[[ArrayBufferData]] is null, return true.
includes: [detachArrayBuffer.js] includes: [detachArrayBuffer.js]
features: [ArrayBuffer, Atomics, TypedArray] features: [ArrayBuffer, Atomics, TypedArray]
---*/ ---*/
@ -29,7 +35,7 @@ const poisoned = {
try { try {
$DETACHBUFFER(i32a.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null $DETACHBUFFER(i32a.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null
} catch (error) { } catch (error) {
$ERROR(`An unexpected error occurred when detaching ArrayBuffer: ${error}`); $ERROR(`An unexpected error occurred when detaching ArrayBuffer: ${error.message}`);
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -3,15 +3,21 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > description: >
A null value for bufferData throws a TypeError A null value for bufferData (detached) throws a TypeError
info: | info: |
Atomics.wait( typedArray, index, value, timeout ) Atomics.wait( typedArray, index, value, timeout )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). Let buffer be ? ValidateIntegerTypedArray(typedArray, true).
...
Let buffer be ? ValidateTypedArray(typedArray).
... ...
9.If IsSharedArrayBuffer(buffer) is false, throw a TypeError exception.
... If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
3.If bufferData is null, return false. ...
If arrayBuffer.[[ArrayBufferData]] is null, return true.
includes: [detachArrayBuffer.js] includes: [detachArrayBuffer.js]
features: [ArrayBuffer, Atomics, TypedArray] features: [ArrayBuffer, Atomics, TypedArray]
---*/ ---*/