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
description: >
A null value for bufferData throws a TypeError
A null value for bufferData (detached) throws a TypeError
info: |
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.
...
3.If bufferData is null, return false.
If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
...
If arrayBuffer.[[ArrayBufferData]] is null, return true.
includes: [detachArrayBuffer.js]
features: [ArrayBuffer, Atomics, TypedArray]
---*/
@ -29,7 +35,7 @@ const poisoned = {
try {
$DETACHBUFFER(i32a.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null
} 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() {

View File

@ -3,15 +3,21 @@
/*---
esid: sec-atomics.wait
description: >
A null value for bufferData throws a TypeError
A null value for bufferData (detached) throws a TypeError
info: |
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.
...
3.If bufferData is null, return false.
If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
...
If arrayBuffer.[[ArrayBufferData]] is null, return true.
includes: [detachArrayBuffer.js]
features: [ArrayBuffer, Atomics, TypedArray]
---*/