Atomics.wake to Atomics.notify

This commit is contained in:
Leo Balter 2018-06-28 16:15:01 -04:00 committed by Rick Waldron
parent 003388e36e
commit 6533378823
40 changed files with 194 additions and 194 deletions

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test range checking of Atomics.wake on arrays that allow atomic operations Test range checking of Atomics.notify on arrays that allow atomic operations
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
.. ..
@ -21,6 +21,6 @@ const i32a = new Int32Array(
testWithAtomicsOutOfBoundsIndices(function(IdxGen) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, IdxGen(i32a), 0); Atomics.notify(i32a, IdxGen(i32a), 0);
}, '`Atomics.wake(i32a, IdxGen(i32a), 0)` throws RangeError'); }, '`Atomics.notify(i32a, IdxGen(i32a), 0)` throws RangeError');
}); });

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test range checking of Atomics.wake on arrays that allow atomic operations Test range checking of Atomics.notify on arrays that allow atomic operations
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
.. ..
@ -21,6 +21,6 @@ const i64a = new BigInt64Array(
testWithAtomicsOutOfBoundsIndices(function(IdxGen) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i64a, IdxGen(i64a), 0); Atomics.notify(i64a, IdxGen(i64a), 0);
}, '`Atomics.wake(i64a, IdxGen(i64a), 0)` throws RangeError'); }, '`Atomics.notify(i64a, IdxGen(i64a), 0)` throws RangeError');
}); });

View File

@ -6,7 +6,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a TypeError if typedArray arg is not an BigInt64Array Throws a TypeError if typedArray arg is not an BigInt64Array
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...

View File

@ -5,7 +5,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...
@ -25,9 +25,9 @@ const poisoned = {
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i64a, 0, 0); Atomics.notify(i64a, 0, 0);
}, '`Atomics.wake(i64a, 0, 0)` throws TypeError'); }, '`Atomics.notify(i64a, 0, 0)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i64a, poisoned, poisoned); Atomics.notify(i64a, poisoned, poisoned);
}, '`Atomics.wake(i64a, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(i64a, poisoned, poisoned)` throws TypeError');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes all waiters on a location, but does not Test that Atomics.notify wakes all waiters on a location, but does not
wake waiters on other locations. wake waiters on other locations.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
@ -68,9 +68,9 @@ $262.agent.tryYield();
// Wake all waiting on WAIT_INDEX, should be 3 always, they won't time out. // Wake all waiting on WAIT_INDEX, should be 3 always, they won't time out.
assert.sameValue( assert.sameValue(
Atomics.wake(i64a, WAIT_INDEX), Atomics.notify(i64a, WAIT_INDEX),
NUMAGENT, NUMAGENT,
'Atomics.wake(i64a, WAIT_INDEX) returns the value of `NUMAGENT`' 'Atomics.notify(i64a, WAIT_INDEX) returns the value of `NUMAGENT`'
); );
Atomics.store(i64a, WAKE_INDEX, 1n); Atomics.store(i64a, WAKE_INDEX, 1n);

View File

@ -5,7 +5,7 @@ esid: sec-atomics.notify
description: > description: >
A null value for bufferData throws a TypeError A null value for bufferData throws a TypeError
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...
@ -32,5 +32,5 @@ try {
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i64a, poisoned, poisoned); Atomics.notify(i64a, poisoned, poisoned);
}, '`Atomics.wake(i64a, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(i64a, poisoned, poisoned)` throws TypeError');

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Allowed boundary cases for 'count' argument to Atomics.wake Allowed boundary cases for 'count' argument to Atomics.notify
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
... ...
3. If count is undefined, let c be +. 3. If count is undefined, let c be +.
@ -30,32 +30,32 @@ const i32a = new Int32Array(
); );
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0, -3), Atomics.notify(i32a, 0, -3),
0, 0,
'Atomics.wake(i32a, 0, -3) returns 0' 'Atomics.notify(i32a, 0, -3) returns 0'
); );
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0, Number.POSITIVE_INFINITY), Atomics.notify(i32a, 0, Number.POSITIVE_INFINITY),
0, 0,
'Atomics.wake(i32a, 0, Number.POSITIVE_INFINITY) returns 0' 'Atomics.notify(i32a, 0, Number.POSITIVE_INFINITY) returns 0'
); );
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0, undefined), Atomics.notify(i32a, 0, undefined),
0, 0,
'Atomics.wake(i32a, 0, undefined) returns 0' 'Atomics.notify(i32a, 0, undefined) returns 0'
); );
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0, '33'), Atomics.notify(i32a, 0, '33'),
0, 0,
'Atomics.wake(i32a, 0, \'33\') returns 0' 'Atomics.notify(i32a, 0, \'33\') returns 0'
); );
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0, { valueOf: 8 }), Atomics.notify(i32a, 0, { valueOf: 8 }),
0, 0,
'Atomics.wake(i32a, 0, {valueOf: 8}) returns 0' 'Atomics.notify(i32a, 0, {valueOf: 8}) returns 0'
); );
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0), Atomics.notify(i32a, 0),
0, 0,
'Atomics.wake(i32a, 0) returns 0' 'Atomics.notify(i32a, 0) returns 0'
); );

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Default to +Infinity when missing 'count' argument to Atomics.wake Default to +Infinity when missing 'count' argument to Atomics.notify
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
... ...
3. If count is undefined, let c be +. 3. If count is undefined, let c be +.
@ -51,8 +51,8 @@ $262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
// actually started to wait. // actually started to wait.
$262.agent.tryYield(); $262.agent.tryYield();
assert.sameValue(Atomics.wake(i32a, WAIT_INDEX /*, count missing */), NUMAGENT, assert.sameValue(Atomics.notify(i32a, WAIT_INDEX /*, count missing */), NUMAGENT,
'Atomics.wake(i32a, WAIT_INDEX /*, count missing */) returns the value of `NUMAGENT`'); 'Atomics.notify(i32a, WAIT_INDEX /*, count missing */) returns the value of `NUMAGENT`');
const reports = []; const reports = [];
for (var i = 0; i < NUMAGENT; i++) { for (var i = 0; i < NUMAGENT; i++) {

View File

@ -6,7 +6,7 @@ esid: sec-atomics.notify
description: > description: >
Undefined count arg should result in an infinite count Undefined count arg should result in an infinite count
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
3.If count is undefined, let c be +. 3.If count is undefined, let c be +.
@ -49,8 +49,8 @@ $262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
// actually started to wait. // actually started to wait.
$262.agent.tryYield(); $262.agent.tryYield();
assert.sameValue(Atomics.wake(i32a, WAIT_INDEX, undefined), NUMAGENT, assert.sameValue(Atomics.notify(i32a, WAIT_INDEX, undefined), NUMAGENT,
'Atomics.wake(i32a, WAIT_INDEX, undefined) returns the value of `NUMAGENT`'); 'Atomics.notify(i32a, WAIT_INDEX, undefined) returns the value of `NUMAGENT`');
const reports = []; const reports = [];
for (var i = 0; i < NUMAGENT; i++) { for (var i = 0; i < NUMAGENT; i++) {

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
NaNs are converted to 0 for 'count' argument to Atomics.wake NaNs are converted to 0 for 'count' argument to Atomics.notify
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
... ...
3. If count is undefined, let c be +. 3. If count is undefined, let c be +.
@ -29,5 +29,5 @@ const i32a = new Int32Array(
); );
NaNs.forEach(nan => { NaNs.forEach(nan => {
assert.sameValue(Atomics.wake(i32a, 0, nan), 0, 'Atomics.wake(i32a, 0, nan) returns 0'); assert.sameValue(Atomics.notify(i32a, 0, nan), 0, 'Atomics.notify(i32a, 0, nan) returns 0');
}); });

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Return abrupt when symbol passed for 'count' argument to Atomics.wake Return abrupt when symbol passed for 'count' argument to Atomics.notify
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
... ...
3. If count is undefined, let c be +. 3. If count is undefined, let c be +.
@ -22,5 +22,5 @@ const i32a = new Int32Array(
); );
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i32a, 0, Symbol()); Atomics.notify(i32a, 0, Symbol());
}, '`Atomics.wake(i32a, 0, Symbol())` throws TypeError'); }, '`Atomics.notify(i32a, 0, Symbol())` throws TypeError');

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Return abrupt when ToInteger throws an exception on 'count' argument to Atomics.wake Return abrupt when ToInteger throws an exception on 'count' argument to Atomics.notify
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
... ...
3. If count is undefined, let c be +. 3. If count is undefined, let c be +.
@ -28,5 +28,5 @@ const poisoned = {
}; };
assert.throws(Test262Error, function() { assert.throws(Test262Error, function() {
Atomics.wake(i32a, 0, poisoned); Atomics.notify(i32a, 0, poisoned);
}, '`Atomics.wake(i32a, 0, poisoned)` throws Test262Error'); }, '`Atomics.notify(i32a, 0, poisoned)` throws Test262Error');

View File

@ -3,7 +3,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: Testing descriptor property of Atomics.wake description: Testing descriptor property of Atomics.notify
includes: [propertyHelper.js] includes: [propertyHelper.js]
features: [Atomics] features: [Atomics]
---*/ ---*/

View File

@ -5,9 +5,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Atomics.wake.length is 3. Atomics.notify.length is 3.
info: | info: |
Atomics.wake ( ia, index, count ) Atomics.notify ( ia, index, count )
17 ECMAScript Standard Built-in Objects: 17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length Every built-in Function object, including constructors, has a length
@ -24,7 +24,7 @@ includes: [propertyHelper.js]
features: [Atomics] features: [Atomics]
---*/ ---*/
verifyProperty(Atomics.wake, 'length', { verifyProperty(Atomics.notify, 'length', {
value: 3, value: 3,
enumerable: false, enumerable: false,
writable: false, writable: false,

View File

@ -5,12 +5,12 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Atomics.wake.name is "wake". Atomics.notify.name is "wake".
includes: [propertyHelper.js] includes: [propertyHelper.js]
features: [Atomics] features: [Atomics]
---*/ ---*/
verifyProperty(Atomics.wake, 'name', { verifyProperty(Atomics.notify, 'name', {
value: 'wake', value: 'wake',
enumerable: false, enumerable: false,
writable: false, writable: false,

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes zero waiters if the count is negative Test that Atomics.notify wakes zero waiters if the count is negative
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -32,6 +32,6 @@ $262.agent.waitUntil(i32a, RUNNING, 1);
// Try to yield control to ensure the agent actually started to wait. // Try to yield control to ensure the agent actually started to wait.
$262.agent.tryYield(); $262.agent.tryYield();
assert.sameValue(Atomics.wake(i32a, 0, -1), 0, 'Atomics.wake(i32a, 0, -1) returns 0'); // Don't actually wake it assert.sameValue(Atomics.notify(i32a, 0, -1), 0, 'Atomics.notify(i32a, 0, -1) returns 0'); // Don't actually notify it
assert.sameValue($262.agent.getReport(), 'timed-out', '$262.agent.getReport() returns "timed-out"'); assert.sameValue($262.agent.getReport(), 'timed-out', '$262.agent.getReport() returns "timed-out"');

View File

@ -6,7 +6,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a RangeError is index < 0 Throws a RangeError is index < 0
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
2.Let i be ? ValidateAtomicAccess(typedArray, index). 2.Let i be ? ValidateAtomicAccess(typedArray, index).
... ...
@ -27,14 +27,14 @@ const poisoned = {
}; };
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, -Infinity, poisoned); Atomics.notify(i32a, -Infinity, poisoned);
}, '`Atomics.wake(i32a, -Infinity, poisoned)` throws RangeError'); }, '`Atomics.notify(i32a, -Infinity, poisoned)` throws RangeError');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, -7.999, poisoned); Atomics.notify(i32a, -7.999, poisoned);
}, '`Atomics.wake(i32a, -7.999, poisoned)` throws RangeError'); }, '`Atomics.notify(i32a, -7.999, poisoned)` throws RangeError');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, -1, poisoned); Atomics.notify(i32a, -1, poisoned);
}, '`Atomics.wake(i32a, -1, poisoned)` throws RangeError'); }, '`Atomics.notify(i32a, -1, poisoned)` throws RangeError');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, -300, poisoned); Atomics.notify(i32a, -300, poisoned);
}, '`Atomics.wake(i32a, -300, poisoned)` throws RangeError'); }, '`Atomics.notify(i32a, -300, poisoned)` throws RangeError');

View File

@ -6,7 +6,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a TypeError if typedArray arg is not an Int32Array Throws a TypeError if typedArray arg is not an Int32Array
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...
@ -25,54 +25,54 @@ assert.throws(TypeError, function() {
const view = new Float64Array( const view = new Float64Array(
new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8)
); );
Atomics.wake(view, poisoned, poisoned); Atomics.notify(view, poisoned, poisoned);
}, '`const view = new Float64Array( new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError'); }, '`const view = new Float64Array( new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
const view = new Float32Array( const view = new Float32Array(
new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4)
); );
Atomics.wake(view, poisoned, poisoned); Atomics.notify(view, poisoned, poisoned);
}, '`const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError'); }, '`const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
const view = new Int16Array( const view = new Int16Array(
new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2)
); );
Atomics.wake(view, poisoned, poisoned); Atomics.notify(view, poisoned, poisoned);
}, '`const view = new Int16Array( new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError'); }, '`const view = new Int16Array( new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
const view = new Int8Array( const view = new Int8Array(
new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT)
); );
Atomics.wake(view, poisoned, poisoned); Atomics.notify(view, poisoned, poisoned);
}, '`const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError'); }, '`const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
const view = new Uint32Array( const view = new Uint32Array(
new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4)
); );
Atomics.wake(new Uint32Array(), poisoned, poisoned); Atomics.notify(new Uint32Array(), poisoned, poisoned);
}, '`const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wake(new Uint32Array(), poisoned, poisoned)` throws TypeError'); }, '`const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(new Uint32Array(), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
const view = new Uint16Array( const view = new Uint16Array(
new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2)
); );
Atomics.wake(view, poisoned, poisoned); Atomics.notify(view, poisoned, poisoned);
}, '`const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError'); }, '`const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
const view = new Uint8Array( const view = new Uint8Array(
new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT)
); );
Atomics.wake(view, poisoned, poisoned); Atomics.notify(view, poisoned, poisoned);
}, '`const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError'); }, '`const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
const view = new Uint8ClampedArray( const view = new Uint8ClampedArray(
new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT)
); );
Atomics.wake(view, poisoned, poisoned); Atomics.notify(view, poisoned, poisoned);
}, '`const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError'); }, '`const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');

View File

@ -5,7 +5,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...
@ -26,9 +26,9 @@ const poisoned = {
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i32a, 0, 0); Atomics.notify(i32a, 0, 0);
}, '`Atomics.wake(i32a, 0, 0)` throws TypeError'); }, '`Atomics.notify(i32a, 0, 0)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i32a, poisoned, poisoned); Atomics.notify(i32a, poisoned, poisoned);
}, '`Atomics.wake(i32a, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(i32a, poisoned, poisoned)` throws TypeError');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test Atomics.wake on non-shared integer TypedArrays Test Atomics.notify on non-shared integer TypedArrays
includes: [testTypedArray.js] includes: [testTypedArray.js]
features: [ArrayBuffer, Atomics, TypedArray] features: [ArrayBuffer, Atomics, TypedArray]
---*/ ---*/
@ -18,25 +18,25 @@ const poisoned = {
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Int16Array(nonsab), poisoned, poisoned); Atomics.notify(new Int16Array(nonsab), poisoned, poisoned);
}, '`Atomics.wake(new Int16Array(nonsab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Int16Array(nonsab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Int8Array(nonsab), poisoned, poisoned); Atomics.notify(new Int8Array(nonsab), poisoned, poisoned);
}, '`Atomics.wake(new Int8Array(nonsab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Int8Array(nonsab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint32Array(nonsab), poisoned, poisoned); Atomics.notify(new Uint32Array(nonsab), poisoned, poisoned);
}, '`Atomics.wake(new Uint32Array(nonsab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint32Array(nonsab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint16Array(nonsab), poisoned, poisoned); Atomics.notify(new Uint16Array(nonsab), poisoned, poisoned);
}, '`Atomics.wake(new Uint16Array(nonsab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint16Array(nonsab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint8Array(nonsab), poisoned, poisoned); Atomics.notify(new Uint8Array(nonsab), poisoned, poisoned);
}, '`Atomics.wake(new Uint8Array(nonsab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint8Array(nonsab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint8ClampedArray(nonsab), poisoned, poisoned); Atomics.notify(new Uint8ClampedArray(nonsab), poisoned, poisoned);
}, '`Atomics.wake(new Uint8ClampedArray(nonsab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint8ClampedArray(nonsab), poisoned, poisoned)` throws TypeError');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test Atomics.wake on non-shared integer TypedArrays Test Atomics.notify on non-shared integer TypedArrays
includes: [testTypedArray.js] includes: [testTypedArray.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -18,25 +18,25 @@ const poisoned = {
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Int16Array(sab), poisoned, poisoned); Atomics.notify(new Int16Array(sab), poisoned, poisoned);
}, '`Atomics.wake(new Int16Array(sab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Int16Array(sab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Int8Array(sab), poisoned, poisoned); Atomics.notify(new Int8Array(sab), poisoned, poisoned);
}, '`Atomics.wake(new Int8Array(sab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Int8Array(sab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint32Array(sab), poisoned, poisoned); Atomics.notify(new Uint32Array(sab), poisoned, poisoned);
}, '`Atomics.wake(new Uint32Array(sab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint32Array(sab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint16Array(sab), poisoned, poisoned); Atomics.notify(new Uint16Array(sab), poisoned, poisoned);
}, '`Atomics.wake(new Uint16Array(sab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint16Array(sab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint8Array(sab), poisoned, poisoned); Atomics.notify(new Uint8Array(sab), poisoned, poisoned);
}, '`Atomics.wake(new Uint8Array(sab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint8Array(sab), poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new Uint8ClampedArray(sab), poisoned, poisoned); Atomics.notify(new Uint8ClampedArray(sab), poisoned, poisoned);
}, '`Atomics.wake(new Uint8ClampedArray(sab), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(new Uint8ClampedArray(sab), poisoned, poisoned)` throws TypeError');

View File

@ -4,13 +4,13 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test Atomics.wake on view values other than TypedArrays Test Atomics.notify on view values other than TypedArrays
includes: [testAtomics.js] includes: [testAtomics.js]
features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray] features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray]
---*/ ---*/
testWithAtomicsNonViewValues(function(nonView) { testWithAtomicsNonViewValues(function(nonView) {
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(nonView, 0, 0); Atomics.notify(nonView, 0, 0);
}, '`Atomics.wake(nonView, 0, 0)` throws TypeError'); // Even with count == 0 }, '`Atomics.notify(nonView, 0, 0)` throws TypeError'); // Even with count == 0
}); });

View File

@ -5,7 +5,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a TypeError if the typedArray arg is not a TypedArray object Throws a TypeError if the typedArray arg is not a TypedArray object
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...

View File

@ -5,7 +5,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a TypeError if typedArray arg is not an Object Throws a TypeError if typedArray arg is not an Object
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...
@ -20,29 +20,29 @@ const poisoned = {
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(null, poisoned, poisoned); Atomics.notify(null, poisoned, poisoned);
}, '`Atomics.wake(null, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(null, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(undefined, poisoned, poisoned); Atomics.notify(undefined, poisoned, poisoned);
}, '`Atomics.wake(undefined, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(undefined, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(true, poisoned, poisoned); Atomics.notify(true, poisoned, poisoned);
}, '`Atomics.wake(true, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(true, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(false, poisoned, poisoned); Atomics.notify(false, poisoned, poisoned);
}, '`Atomics.wake(false, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(false, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake('***string***', poisoned, poisoned); Atomics.notify('***string***', poisoned, poisoned);
}, '`Atomics.wake(\'***string***\', poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(\'***string***\', poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(Number.NEGATIVE_INFINITY, poisoned, poisoned); Atomics.notify(Number.NEGATIVE_INFINITY, poisoned, poisoned);
}, '`Atomics.wake(Number.NEGATIVE_INFINITY, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(Number.NEGATIVE_INFINITY, poisoned, poisoned)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(Symbol('***symbol***'), poisoned, poisoned); Atomics.notify(Symbol('***symbol***'), poisoned, poisoned);
}, '`Atomics.wake(Symbol(\'***symbol***\'), poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(Symbol(\'***symbol***\'), poisoned, poisoned)` throws TypeError');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes all waiters on a location, but does not Test that Atomics.notify wakes all waiters on a location, but does not
wake waiters on other locations. wake waiters on other locations.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
@ -68,9 +68,9 @@ $262.agent.tryYield();
// Wake all waiting on WAIT_INDEX, should be 3 always, they won't time out. // Wake all waiting on WAIT_INDEX, should be 3 always, they won't time out.
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, WAIT_INDEX), Atomics.notify(i32a, WAIT_INDEX),
NUMAGENT, NUMAGENT,
'Atomics.wake(i32a, WAIT_INDEX) returns the value of `NUMAGENT`' 'Atomics.notify(i32a, WAIT_INDEX) returns the value of `NUMAGENT`'
); );
Atomics.store(i32a, WAKE_INDEX, 1); Atomics.store(i32a, WAKE_INDEX, 1);

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes all waiters if that's what the count is. Test that Atomics.notify wakes all waiters if that's what the count is.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -41,9 +41,9 @@ $262.agent.tryYield();
// Wake all waiting on WAIT_INDEX, should be 3 always, they won't time out. // Wake all waiting on WAIT_INDEX, should be 3 always, they won't time out.
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, WAIT_INDEX), Atomics.notify(i32a, WAIT_INDEX),
NUMAGENT, NUMAGENT,
'Atomics.wake(i32a, WAIT_INDEX) returns the value of `NUMAGENT`' 'Atomics.notify(i32a, WAIT_INDEX) returns the value of `NUMAGENT`'
); );
for (var i = 0; i < NUMAGENT; i++) { for (var i = 0; i < NUMAGENT; i++) {

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes agents in the order they are waiting. Test that Atomics.notify wakes agents in the order they are waiting.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -64,9 +64,9 @@ for (var i = 0; i < NUMAGENT; i++) {
var notified = []; var notified = [];
for (var i = 0; i < NUMAGENT; i++) { for (var i = 0; i < NUMAGENT; i++) {
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, WAIT_INDEX, 1), Atomics.notify(i32a, WAIT_INDEX, 1),
1, 1,
`Atomics.wake(i32a, WAIT_INDEX, 1) returns 1 (${i})` `Atomics.notify(i32a, WAIT_INDEX, 1) returns 1 (${i})`
); );
notified.push($262.agent.getReport()); notified.push($262.agent.getReport());

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes agents in the order they are waiting. Test that Atomics.notify wakes agents in the order they are waiting.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -64,9 +64,9 @@ for (var i = 0; i < NUMAGENT; i++) {
var notified = []; var notified = [];
for (var i = 0; i < NUMAGENT; i++) { for (var i = 0; i < NUMAGENT; i++) {
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, WAIT_INDEX, 1), Atomics.notify(i32a, WAIT_INDEX, 1),
1, 1,
`Atomics.wake(i32a, WAIT_INDEX, 1) returns 1 (${i})` `Atomics.notify(i32a, WAIT_INDEX, 1) returns 1 (${i})`
); );
notified.push($262.agent.getReport()); notified.push($262.agent.getReport());

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes zero waiters if the count is NaN Test that Atomics.nofity nofities zero waiters if the count is NaN
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -32,7 +32,7 @@ $262.agent.waitUntil(i32a, RUNNING, 1);
// Try to yield control to ensure the agent actually started to wait. // Try to yield control to ensure the agent actually started to wait.
$262.agent.tryYield(); $262.agent.tryYield();
assert.sameValue(Atomics.wake(i32a, 0, NaN), 0, 'Atomics.wake(i32a, 0, NaN) returns 0'); assert.sameValue(Atomics.notify(i32a, 0, NaN), 0, 'Atomics.notify(i32a, 0, NaN) returns 0');
// Try to sleep past the timeout. // Try to sleep past the timeout.
$262.agent.trySleep(TIMEOUT); $262.agent.trySleep(TIMEOUT);

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes one waiter if that's what the count is. Test that Atomics.notify wakes one waiter if that's what the count is.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -46,9 +46,9 @@ $262.agent.tryYield();
// tryYield() took much longer than anticipated and workers have started timing // tryYield() took much longer than anticipated and workers have started timing
// out. // out.
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0, WAKECOUNT), Atomics.notify(i32a, 0, WAKECOUNT),
WAKECOUNT, WAKECOUNT,
'Atomics.wake(i32a, 0, WAKECOUNT) returns the value of `WAKECOUNT`' 'Atomics.notify(i32a, 0, WAKECOUNT) returns the value of `WAKECOUNT`'
); );
// Try to sleep past the timeout. // Try to sleep past the timeout.

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake on awoken waiter is a noop. Test that Atomics.notify on awoken waiter is a noop.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -33,9 +33,9 @@ $262.agent.waitUntil(i32a, RUNNING, 1);
// Try to yield control to ensure the agent actually started to wait. // Try to yield control to ensure the agent actually started to wait.
$262.agent.tryYield(); $262.agent.tryYield();
assert.sameValue(Atomics.wake(i32a, 0, 1), 1, 'Atomics.wake(i32a, 0, 1) returns 1'); assert.sameValue(Atomics.notify(i32a, 0, 1), 1, 'Atomics.notify(i32a, 0, 1) returns 1');
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"'); assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
// Already awake, this should be a noop // Already awake, this should be a noop
assert.sameValue(Atomics.wake(i32a, 0, 1), 0, 'Atomics.wake(i32a, 0, 1) returns 0'); assert.sameValue(Atomics.notify(i32a, 0, 1), 0, 'Atomics.notify(i32a, 0, 1) returns 0');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes two waiters if that's what the count is. Test that Atomics.notify wakes two waiters if that's what the count is.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -46,9 +46,9 @@ $262.agent.tryYield();
// tryYield() took much longer than anticipated and workers have started timing // tryYield() took much longer than anticipated and workers have started timing
// out. // out.
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, 0, WAKECOUNT), Atomics.notify(i32a, 0, WAKECOUNT),
WAKECOUNT, WAKECOUNT,
'Atomics.wake(i32a, 0, WAKECOUNT) returns the value of `WAKECOUNT`' 'Atomics.notify(i32a, 0, WAKECOUNT) returns the value of `WAKECOUNT`'
); );
// Try to sleep past the timeout. // Try to sleep past the timeout.

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes zero waiters if there are no agents waiting. Test that Atomics.notify wakes zero waiters if there are no agents waiting.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -28,4 +28,4 @@ $262.agent.broadcast(i32a.buffer);
$262.agent.waitUntil(i32a, RUNNING, 1); $262.agent.waitUntil(i32a, RUNNING, 1);
// There are ZERO agents waiting to wake... // There are ZERO agents waiting to wake...
assert.sameValue(Atomics.wake(i32a, 0, 1), 0, 'Atomics.wake(i32a, 0, 1) returns 0'); assert.sameValue(Atomics.notify(i32a, 0, 1), 0, 'Atomics.notify(i32a, 0, 1) returns 0');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes zero waiters if there are no waiters Test that Atomics.notify wakes zero waiters if there are no waiters
at the index specified. at the index specified.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
@ -28,4 +28,4 @@ $262.agent.broadcast(i32a.buffer);
$262.agent.waitUntil(i32a, RUNNING, 1); $262.agent.waitUntil(i32a, RUNNING, 1);
// There are ZERO matching agents waiting on index 1 // There are ZERO matching agents waiting on index 1
assert.sameValue(Atomics.wake(i32a, 1, 1), 0, 'Atomics.wake(i32a, 1, 1) returns 0'); assert.sameValue(Atomics.notify(i32a, 1, 1), 0, 'Atomics.notify(i32a, 1, 1) returns 0');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test that Atomics.wake wakes zero waiters if that's what the count is. Test that Atomics.notify wakes zero waiters if that's what the count is.
includes: [atomicsHelper.js] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -43,9 +43,9 @@ $262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
$262.agent.tryYield(); $262.agent.tryYield();
assert.sameValue( assert.sameValue(
Atomics.wake(i32a, WAIT_INDEX, WAKECOUNT), Atomics.notify(i32a, WAIT_INDEX, WAKECOUNT),
WAKECOUNT, WAKECOUNT,
'Atomics.wake(i32a, WAIT_INDEX, WAKECOUNT) returns the value of `WAKECOUNT`' 'Atomics.notify(i32a, WAIT_INDEX, WAKECOUNT) returns the value of `WAKECOUNT`'
); );
// Try to sleep past the timeout. // Try to sleep past the timeout.

View File

@ -5,7 +5,7 @@ esid: sec-atomics.notify
description: > description: >
A null value for bufferData throws a TypeError A null value for bufferData throws a TypeError
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
... ...
@ -33,5 +33,5 @@ try {
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i32a, poisoned, poisoned); Atomics.notify(i32a, poisoned, poisoned);
}, '`Atomics.wake(i32a, poisoned, poisoned)` throws TypeError'); }, '`Atomics.notify(i32a, poisoned, poisoned)` throws TypeError');

View File

@ -6,7 +6,7 @@ esid: sec-atomics.notify
description: > description: >
Throws a RangeError if value of index arg is out of range Throws a RangeError if value of index arg is out of range
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
2.Let i be ? ValidateAtomicAccess(typedArray, index). 2.Let i be ? ValidateAtomicAccess(typedArray, index).
... ...
@ -27,11 +27,11 @@ var poisoned = {
}; };
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, Infinity, poisoned); Atomics.notify(i32a, Infinity, poisoned);
}, '`Atomics.wake(i32a, Infinity, poisoned)` throws RangeError'); }, '`Atomics.notify(i32a, Infinity, poisoned)` throws RangeError');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, 4, poisoned); Atomics.notify(i32a, 4, poisoned);
}, '`Atomics.wake(i32a, 4, poisoned)` throws RangeError'); }, '`Atomics.notify(i32a, 4, poisoned)` throws RangeError');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, 200, poisoned); Atomics.notify(i32a, 200, poisoned);
}, '`Atomics.wake(i32a, 200, poisoned)` throws RangeError'); }, '`Atomics.notify(i32a, 200, poisoned)` throws RangeError');

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Test Atomics.wake on shared non-integer TypedArrays Test Atomics.notify on shared non-integer TypedArrays
includes: [testTypedArray.js] includes: [testTypedArray.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
@ -13,8 +13,8 @@ var buffer = new SharedArrayBuffer(1024);
testWithTypedArrayConstructors(function(TA) { testWithTypedArrayConstructors(function(TA) {
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(new TA(buffer), 0, 0); Atomics.notify(new TA(buffer), 0, 0);
}, '`Atomics.wake(new TA(buffer), 0, 0)` throws TypeError'); }, '`Atomics.notify(new TA(buffer), 0, 0)` throws TypeError');
}, floatArrayConstructors); }, floatArrayConstructors);

View File

@ -4,9 +4,9 @@
/*--- /*---
esid: sec-atomics.notify esid: sec-atomics.notify
description: > description: >
Return abrupt when ToInteger throws for 'index' argument to Atomics.wake Return abrupt when ToInteger throws for 'index' argument to Atomics.notify
info: | info: |
Atomics.wake( typedArray, index, value, timeout ) Atomics.notify( typedArray, index, value, timeout )
2. Let i be ? ValidateAtomicAccess(typedArray, index). 2. Let i be ? ValidateAtomicAccess(typedArray, index).
@ -45,17 +45,17 @@ const poisonedToPrimitive = {
}; };
assert.throws(Test262Error, function() { assert.throws(Test262Error, function() {
Atomics.wake(i32a, poisonedValueOf, poisonedValueOf); Atomics.notify(i32a, poisonedValueOf, poisonedValueOf);
}, '`Atomics.wake(i32a, poisonedValueOf, poisonedValueOf)` throws Test262Error'); }, '`Atomics.notify(i32a, poisonedValueOf, poisonedValueOf)` throws Test262Error');
assert.throws(Test262Error, function() { assert.throws(Test262Error, function() {
Atomics.wake(i32a, poisonedToPrimitive, poisonedToPrimitive); Atomics.notify(i32a, poisonedToPrimitive, poisonedToPrimitive);
}, '`Atomics.wake(i32a, poisonedToPrimitive, poisonedToPrimitive)` throws Test262Error'); }, '`Atomics.notify(i32a, poisonedToPrimitive, poisonedToPrimitive)` throws Test262Error');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i32a, Symbol("foo"), poisonedValueOf); Atomics.notify(i32a, Symbol("foo"), poisonedValueOf);
}, '`Atomics.wake(i32a, Symbol("foo"), poisonedValueOf)` throws TypeError'); }, '`Atomics.notify(i32a, Symbol("foo"), poisonedValueOf)` throws TypeError');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Atomics.wake(i32a, Symbol("foo"), poisonedToPrimitive); Atomics.notify(i32a, Symbol("foo"), poisonedToPrimitive);
}, '`Atomics.wake(i32a, Symbol("foo"), poisonedToPrimitive)` throws TypeError'); }, '`Atomics.notify(i32a, Symbol("foo"), poisonedToPrimitive)` throws TypeError');

View File

@ -6,7 +6,7 @@ esid: sec-atomics.notify
description: > description: >
An undefined index arg should translate to 0 An undefined index arg should translate to 0
info: | info: |
Atomics.wake( typedArray, index, count ) Atomics.notify( typedArray, index, count )
2.Let i be ? ValidateAtomicAccess(typedArray, index). 2.Let i be ? ValidateAtomicAccess(typedArray, index).
... ...
@ -60,14 +60,14 @@ $262.agent.tryYield();
// Wake at index 0, undefined => 0. // Wake at index 0, undefined => 0.
var woken = 0; var woken = 0;
while ((woken = Atomics.wake(i32a, undefined, 1)) === 0) ; while ((woken = Atomics.notify(i32a, undefined, 1)) === 0) ;
assert.sameValue(woken, 1, 'Atomics.wake(i32a, undefined, 1) returns 1'); assert.sameValue(woken, 1, 'Atomics.notify(i32a, undefined, 1) returns 1');
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"'); assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
// Wake again at index 0, default => 0. // Wake again at index 0, default => 0.
var woken = 0; var woken = 0;
while ((woken = Atomics.wake(i32a, /*, default values used */)) === 0) ; while ((woken = Atomics.notify(i32a, /*, default values used */)) === 0) ;
assert.sameValue(woken, 1, 'Atomics.wake(i32a /*, default values used */) returns 1'); assert.sameValue(woken, 1, 'Atomics.notify(i32a /*, default values used */) returns 1');
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"'); assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');