mirror of
https://github.com/tc39/test262.git
synced 2025-07-29 17:04:31 +02:00
Atomics.wake to Atomics.notify
This commit is contained in:
parent
003388e36e
commit
6533378823
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
..
|
||||
@ -21,6 +21,6 @@ const i32a = new Int32Array(
|
||||
|
||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, IdxGen(i32a), 0);
|
||||
}, '`Atomics.wake(i32a, IdxGen(i32a), 0)` throws RangeError');
|
||||
Atomics.notify(i32a, IdxGen(i32a), 0);
|
||||
}, '`Atomics.notify(i32a, IdxGen(i32a), 0)` throws RangeError');
|
||||
});
|
||||
|
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
..
|
||||
@ -21,6 +21,6 @@ const i64a = new BigInt64Array(
|
||||
|
||||
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i64a, IdxGen(i64a), 0);
|
||||
}, '`Atomics.wake(i64a, IdxGen(i64a), 0)` throws RangeError');
|
||||
Atomics.notify(i64a, IdxGen(i64a), 0);
|
||||
}, '`Atomics.notify(i64a, IdxGen(i64a), 0)` throws RangeError');
|
||||
});
|
||||
|
@ -6,7 +6,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a TypeError if typedArray arg is not an BigInt64Array
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
|
@ -5,7 +5,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
@ -25,9 +25,9 @@ const poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i64a, 0, 0);
|
||||
}, '`Atomics.wake(i64a, 0, 0)` throws TypeError');
|
||||
Atomics.notify(i64a, 0, 0);
|
||||
}, '`Atomics.notify(i64a, 0, 0)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i64a, poisoned, poisoned);
|
||||
}, '`Atomics.wake(i64a, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(i64a, poisoned, poisoned);
|
||||
}, '`Atomics.notify(i64a, poisoned, poisoned)` throws TypeError');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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.
|
||||
includes: [atomicsHelper.js]
|
||||
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.
|
||||
assert.sameValue(
|
||||
Atomics.wake(i64a, WAIT_INDEX),
|
||||
Atomics.notify(i64a, WAIT_INDEX),
|
||||
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);
|
||||
|
@ -5,7 +5,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
A null value for bufferData throws a TypeError
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
@ -32,5 +32,5 @@ try {
|
||||
}
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i64a, poisoned, poisoned);
|
||||
}, '`Atomics.wake(i64a, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(i64a, poisoned, poisoned);
|
||||
}, '`Atomics.notify(i64a, poisoned, poisoned)` throws TypeError');
|
||||
|
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Allowed boundary cases for 'count' argument to Atomics.wake
|
||||
Allowed boundary cases for 'count' argument to Atomics.notify
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
...
|
||||
3. If count is undefined, let c be +∞.
|
||||
@ -30,32 +30,32 @@ const i32a = new Int32Array(
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0, -3),
|
||||
Atomics.notify(i32a, 0, -3),
|
||||
0,
|
||||
'Atomics.wake(i32a, 0, -3) returns 0'
|
||||
'Atomics.notify(i32a, 0, -3) returns 0'
|
||||
);
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0, Number.POSITIVE_INFINITY),
|
||||
Atomics.notify(i32a, 0, Number.POSITIVE_INFINITY),
|
||||
0,
|
||||
'Atomics.wake(i32a, 0, Number.POSITIVE_INFINITY) returns 0'
|
||||
'Atomics.notify(i32a, 0, Number.POSITIVE_INFINITY) returns 0'
|
||||
);
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0, undefined),
|
||||
Atomics.notify(i32a, 0, undefined),
|
||||
0,
|
||||
'Atomics.wake(i32a, 0, undefined) returns 0'
|
||||
'Atomics.notify(i32a, 0, undefined) returns 0'
|
||||
);
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0, '33'),
|
||||
Atomics.notify(i32a, 0, '33'),
|
||||
0,
|
||||
'Atomics.wake(i32a, 0, \'33\') returns 0'
|
||||
'Atomics.notify(i32a, 0, \'33\') returns 0'
|
||||
);
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0, { valueOf: 8 }),
|
||||
Atomics.notify(i32a, 0, { valueOf: 8 }),
|
||||
0,
|
||||
'Atomics.wake(i32a, 0, {valueOf: 8}) returns 0'
|
||||
'Atomics.notify(i32a, 0, {valueOf: 8}) returns 0'
|
||||
);
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0),
|
||||
Atomics.notify(i32a, 0),
|
||||
0,
|
||||
'Atomics.wake(i32a, 0) returns 0'
|
||||
'Atomics.notify(i32a, 0) returns 0'
|
||||
);
|
||||
|
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Default to +Infinity when missing 'count' argument to Atomics.wake
|
||||
Default to +Infinity when missing 'count' argument to Atomics.notify
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
...
|
||||
3. If count is undefined, let c be +∞.
|
||||
@ -51,8 +51,8 @@ $262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
|
||||
// actually started to wait.
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, WAIT_INDEX /*, count missing */), NUMAGENT,
|
||||
'Atomics.wake(i32a, WAIT_INDEX /*, count missing */) returns the value of `NUMAGENT`');
|
||||
assert.sameValue(Atomics.notify(i32a, WAIT_INDEX /*, count missing */), NUMAGENT,
|
||||
'Atomics.notify(i32a, WAIT_INDEX /*, count missing */) returns the value of `NUMAGENT`');
|
||||
|
||||
const reports = [];
|
||||
for (var i = 0; i < NUMAGENT; i++) {
|
||||
|
@ -6,7 +6,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Undefined count arg should result in an infinite count
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
3.If count is undefined, let c be +∞.
|
||||
|
||||
@ -49,8 +49,8 @@ $262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
|
||||
// actually started to wait.
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, WAIT_INDEX, undefined), NUMAGENT,
|
||||
'Atomics.wake(i32a, WAIT_INDEX, undefined) returns the value of `NUMAGENT`');
|
||||
assert.sameValue(Atomics.notify(i32a, WAIT_INDEX, undefined), NUMAGENT,
|
||||
'Atomics.notify(i32a, WAIT_INDEX, undefined) returns the value of `NUMAGENT`');
|
||||
|
||||
const reports = [];
|
||||
for (var i = 0; i < NUMAGENT; i++) {
|
||||
|
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
NaNs are converted to 0 for 'count' argument to Atomics.wake
|
||||
NaNs are converted to 0 for 'count' argument to Atomics.notify
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
...
|
||||
3. If count is undefined, let c be +∞.
|
||||
@ -29,5 +29,5 @@ const i32a = new Int32Array(
|
||||
);
|
||||
|
||||
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');
|
||||
});
|
||||
|
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Return abrupt when symbol passed for 'count' argument to Atomics.wake
|
||||
Return abrupt when symbol passed for 'count' argument to Atomics.notify
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
...
|
||||
3. If count is undefined, let c be +∞.
|
||||
@ -22,5 +22,5 @@ const i32a = new Int32Array(
|
||||
);
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i32a, 0, Symbol());
|
||||
}, '`Atomics.wake(i32a, 0, Symbol())` throws TypeError');
|
||||
Atomics.notify(i32a, 0, Symbol());
|
||||
}, '`Atomics.notify(i32a, 0, Symbol())` throws TypeError');
|
||||
|
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
...
|
||||
3. If count is undefined, let c be +∞.
|
||||
@ -28,5 +28,5 @@ const poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Atomics.wake(i32a, 0, poisoned);
|
||||
}, '`Atomics.wake(i32a, 0, poisoned)` throws Test262Error');
|
||||
Atomics.notify(i32a, 0, poisoned);
|
||||
}, '`Atomics.notify(i32a, 0, poisoned)` throws Test262Error');
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: Testing descriptor property of Atomics.wake
|
||||
description: Testing descriptor property of Atomics.notify
|
||||
includes: [propertyHelper.js]
|
||||
features: [Atomics]
|
||||
---*/
|
||||
|
@ -5,9 +5,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Atomics.wake.length is 3.
|
||||
Atomics.notify.length is 3.
|
||||
info: |
|
||||
Atomics.wake ( ia, index, count )
|
||||
Atomics.notify ( ia, index, count )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
@ -24,7 +24,7 @@ includes: [propertyHelper.js]
|
||||
features: [Atomics]
|
||||
---*/
|
||||
|
||||
verifyProperty(Atomics.wake, 'length', {
|
||||
verifyProperty(Atomics.notify, 'length', {
|
||||
value: 3,
|
||||
enumerable: false,
|
||||
writable: false,
|
||||
|
@ -5,12 +5,12 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Atomics.wake.name is "wake".
|
||||
Atomics.notify.name is "wake".
|
||||
includes: [propertyHelper.js]
|
||||
features: [Atomics]
|
||||
---*/
|
||||
|
||||
verifyProperty(Atomics.wake, 'name', {
|
||||
verifyProperty(Atomics.notify, 'name', {
|
||||
value: 'wake',
|
||||
enumerable: false,
|
||||
writable: false,
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
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.
|
||||
$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"');
|
||||
|
@ -6,7 +6,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a RangeError is index < 0
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
2.Let i be ? ValidateAtomicAccess(typedArray, index).
|
||||
...
|
||||
@ -27,14 +27,14 @@ const poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, -Infinity, poisoned);
|
||||
}, '`Atomics.wake(i32a, -Infinity, poisoned)` throws RangeError');
|
||||
Atomics.notify(i32a, -Infinity, poisoned);
|
||||
}, '`Atomics.notify(i32a, -Infinity, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, -7.999, poisoned);
|
||||
}, '`Atomics.wake(i32a, -7.999, poisoned)` throws RangeError');
|
||||
Atomics.notify(i32a, -7.999, poisoned);
|
||||
}, '`Atomics.notify(i32a, -7.999, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, -1, poisoned);
|
||||
}, '`Atomics.wake(i32a, -1, poisoned)` throws RangeError');
|
||||
Atomics.notify(i32a, -1, poisoned);
|
||||
}, '`Atomics.notify(i32a, -1, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, -300, poisoned);
|
||||
}, '`Atomics.wake(i32a, -300, poisoned)` throws RangeError');
|
||||
Atomics.notify(i32a, -300, poisoned);
|
||||
}, '`Atomics.notify(i32a, -300, poisoned)` throws RangeError');
|
||||
|
@ -6,7 +6,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a TypeError if typedArray arg is not an Int32Array
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
@ -25,54 +25,54 @@ assert.throws(TypeError, function() {
|
||||
const view = new Float64Array(
|
||||
new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8)
|
||||
);
|
||||
Atomics.wake(view, poisoned, poisoned);
|
||||
}, '`const view = new Float64Array( new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(view, poisoned, poisoned);
|
||||
}, '`const view = new Float64Array( new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
const view = new Float32Array(
|
||||
new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4)
|
||||
);
|
||||
Atomics.wake(view, poisoned, poisoned);
|
||||
}, '`const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(view, poisoned, poisoned);
|
||||
}, '`const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
const view = new Int16Array(
|
||||
new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2)
|
||||
);
|
||||
Atomics.wake(view, poisoned, poisoned);
|
||||
}, '`const view = new Int16Array( new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(view, poisoned, poisoned);
|
||||
}, '`const view = new Int16Array( new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
const view = new Int8Array(
|
||||
new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT)
|
||||
);
|
||||
Atomics.wake(view, poisoned, poisoned);
|
||||
}, '`const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(view, poisoned, poisoned);
|
||||
}, '`const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
const view = new Uint32Array(
|
||||
new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4)
|
||||
);
|
||||
Atomics.wake(new Uint32Array(), poisoned, poisoned);
|
||||
}, '`const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wake(new Uint32Array(), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint32Array(), poisoned, poisoned);
|
||||
}, '`const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(new Uint32Array(), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
const view = new Uint16Array(
|
||||
new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2)
|
||||
);
|
||||
Atomics.wake(view, poisoned, poisoned);
|
||||
}, '`const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(view, poisoned, poisoned);
|
||||
}, '`const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
const view = new Uint8Array(
|
||||
new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT)
|
||||
);
|
||||
Atomics.wake(view, poisoned, poisoned);
|
||||
}, '`const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(view, poisoned, poisoned);
|
||||
}, '`const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
const view = new Uint8ClampedArray(
|
||||
new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT)
|
||||
);
|
||||
Atomics.wake(view, poisoned, poisoned);
|
||||
}, '`const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.wake(view, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(view, poisoned, poisoned);
|
||||
}, '`const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError');
|
||||
|
@ -5,7 +5,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
@ -26,9 +26,9 @@ const poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i32a, 0, 0);
|
||||
}, '`Atomics.wake(i32a, 0, 0)` throws TypeError');
|
||||
Atomics.notify(i32a, 0, 0);
|
||||
}, '`Atomics.notify(i32a, 0, 0)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i32a, poisoned, poisoned);
|
||||
}, '`Atomics.wake(i32a, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(i32a, poisoned, poisoned);
|
||||
}, '`Atomics.notify(i32a, poisoned, poisoned)` throws TypeError');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Test Atomics.wake on non-shared integer TypedArrays
|
||||
Test Atomics.notify on non-shared integer TypedArrays
|
||||
includes: [testTypedArray.js]
|
||||
features: [ArrayBuffer, Atomics, TypedArray]
|
||||
---*/
|
||||
@ -18,25 +18,25 @@ const poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Int16Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Int16Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Int16Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Int16Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Int8Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Int8Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Int8Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Int8Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint32Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint32Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint32Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint32Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint16Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint16Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint16Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint16Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint8Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint8Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint8Array(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint8Array(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint8ClampedArray(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint8ClampedArray(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint8ClampedArray(nonsab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint8ClampedArray(nonsab), poisoned, poisoned)` throws TypeError');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Test Atomics.wake on non-shared integer TypedArrays
|
||||
Test Atomics.notify on non-shared integer TypedArrays
|
||||
includes: [testTypedArray.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -18,25 +18,25 @@ const poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Int16Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Int16Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Int16Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Int16Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Int8Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Int8Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Int8Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Int8Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint32Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint32Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint32Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint32Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint16Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint16Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint16Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint16Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint8Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint8Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint8Array(sab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint8Array(sab), poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new Uint8ClampedArray(sab), poisoned, poisoned);
|
||||
}, '`Atomics.wake(new Uint8ClampedArray(sab), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(new Uint8ClampedArray(sab), poisoned, poisoned);
|
||||
}, '`Atomics.notify(new Uint8ClampedArray(sab), poisoned, poisoned)` throws TypeError');
|
||||
|
@ -4,13 +4,13 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Test Atomics.wake on view values other than TypedArrays
|
||||
Test Atomics.notify on view values other than TypedArrays
|
||||
includes: [testAtomics.js]
|
||||
features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray]
|
||||
---*/
|
||||
|
||||
testWithAtomicsNonViewValues(function(nonView) {
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(nonView, 0, 0);
|
||||
}, '`Atomics.wake(nonView, 0, 0)` throws TypeError'); // Even with count == 0
|
||||
Atomics.notify(nonView, 0, 0);
|
||||
}, '`Atomics.notify(nonView, 0, 0)` throws TypeError'); // Even with count == 0
|
||||
});
|
||||
|
@ -5,7 +5,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a TypeError if the typedArray arg is not a TypedArray object
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
|
@ -5,7 +5,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a TypeError if typedArray arg is not an Object
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
@ -20,29 +20,29 @@ const poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(null, poisoned, poisoned);
|
||||
}, '`Atomics.wake(null, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(null, poisoned, poisoned);
|
||||
}, '`Atomics.notify(null, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(undefined, poisoned, poisoned);
|
||||
}, '`Atomics.wake(undefined, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(undefined, poisoned, poisoned);
|
||||
}, '`Atomics.notify(undefined, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(true, poisoned, poisoned);
|
||||
}, '`Atomics.wake(true, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(true, poisoned, poisoned);
|
||||
}, '`Atomics.notify(true, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(false, poisoned, poisoned);
|
||||
}, '`Atomics.wake(false, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(false, poisoned, poisoned);
|
||||
}, '`Atomics.notify(false, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake('***string***', poisoned, poisoned);
|
||||
}, '`Atomics.wake(\'***string***\', poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify('***string***', poisoned, poisoned);
|
||||
}, '`Atomics.notify(\'***string***\', poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(Number.NEGATIVE_INFINITY, poisoned, poisoned);
|
||||
}, '`Atomics.wake(Number.NEGATIVE_INFINITY, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(Number.NEGATIVE_INFINITY, poisoned, poisoned);
|
||||
}, '`Atomics.notify(Number.NEGATIVE_INFINITY, poisoned, poisoned)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(Symbol('***symbol***'), poisoned, poisoned);
|
||||
}, '`Atomics.wake(Symbol(\'***symbol***\'), poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(Symbol('***symbol***'), poisoned, poisoned);
|
||||
}, '`Atomics.notify(Symbol(\'***symbol***\'), poisoned, poisoned)` throws TypeError');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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.
|
||||
includes: [atomicsHelper.js]
|
||||
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.
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, WAIT_INDEX),
|
||||
Atomics.notify(i32a, WAIT_INDEX),
|
||||
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);
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
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.
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, WAIT_INDEX),
|
||||
Atomics.notify(i32a, WAIT_INDEX),
|
||||
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++) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -64,9 +64,9 @@ for (var i = 0; i < NUMAGENT; i++) {
|
||||
var notified = [];
|
||||
for (var i = 0; i < NUMAGENT; i++) {
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, WAIT_INDEX, 1),
|
||||
Atomics.notify(i32a, WAIT_INDEX, 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());
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -64,9 +64,9 @@ for (var i = 0; i < NUMAGENT; i++) {
|
||||
var notified = [];
|
||||
for (var i = 0; i < NUMAGENT; i++) {
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, WAIT_INDEX, 1),
|
||||
Atomics.notify(i32a, WAIT_INDEX, 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());
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
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.
|
||||
$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.
|
||||
$262.agent.trySleep(TIMEOUT);
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -46,9 +46,9 @@ $262.agent.tryYield();
|
||||
// tryYield() took much longer than anticipated and workers have started timing
|
||||
// out.
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0, WAKECOUNT),
|
||||
Atomics.notify(i32a, 0, 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.
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Test that Atomics.wake on awoken waiter is a noop.
|
||||
Test that Atomics.notify on awoken waiter is a noop.
|
||||
includes: [atomicsHelper.js]
|
||||
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.
|
||||
$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"');
|
||||
|
||||
// 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');
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -46,9 +46,9 @@ $262.agent.tryYield();
|
||||
// tryYield() took much longer than anticipated and workers have started timing
|
||||
// out.
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, 0, WAKECOUNT),
|
||||
Atomics.notify(i32a, 0, 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.
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -28,4 +28,4 @@ $262.agent.broadcast(i32a.buffer);
|
||||
$262.agent.waitUntil(i32a, RUNNING, 1);
|
||||
|
||||
// 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');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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.
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
@ -28,4 +28,4 @@ $262.agent.broadcast(i32a.buffer);
|
||||
$262.agent.waitUntil(i32a, RUNNING, 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');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
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]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -43,9 +43,9 @@ $262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, WAIT_INDEX, WAKECOUNT),
|
||||
Atomics.notify(i32a, WAIT_INDEX, 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.
|
||||
|
@ -5,7 +5,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
A null value for bufferData throws a TypeError
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
||||
...
|
||||
@ -33,5 +33,5 @@ try {
|
||||
}
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i32a, poisoned, poisoned);
|
||||
}, '`Atomics.wake(i32a, poisoned, poisoned)` throws TypeError');
|
||||
Atomics.notify(i32a, poisoned, poisoned);
|
||||
}, '`Atomics.notify(i32a, poisoned, poisoned)` throws TypeError');
|
||||
|
@ -6,7 +6,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
Throws a RangeError if value of index arg is out of range
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
2.Let i be ? ValidateAtomicAccess(typedArray, index).
|
||||
...
|
||||
@ -27,11 +27,11 @@ var poisoned = {
|
||||
};
|
||||
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, Infinity, poisoned);
|
||||
}, '`Atomics.wake(i32a, Infinity, poisoned)` throws RangeError');
|
||||
Atomics.notify(i32a, Infinity, poisoned);
|
||||
}, '`Atomics.notify(i32a, Infinity, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, 4, poisoned);
|
||||
}, '`Atomics.wake(i32a, 4, poisoned)` throws RangeError');
|
||||
Atomics.notify(i32a, 4, poisoned);
|
||||
}, '`Atomics.notify(i32a, 4, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wake(i32a, 200, poisoned);
|
||||
}, '`Atomics.wake(i32a, 200, poisoned)` throws RangeError');
|
||||
Atomics.notify(i32a, 200, poisoned);
|
||||
}, '`Atomics.notify(i32a, 200, poisoned)` throws RangeError');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Test Atomics.wake on shared non-integer TypedArrays
|
||||
Test Atomics.notify on shared non-integer TypedArrays
|
||||
includes: [testTypedArray.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -13,8 +13,8 @@ var buffer = new SharedArrayBuffer(1024);
|
||||
|
||||
testWithTypedArrayConstructors(function(TA) {
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(new TA(buffer), 0, 0);
|
||||
}, '`Atomics.wake(new TA(buffer), 0, 0)` throws TypeError');
|
||||
Atomics.notify(new TA(buffer), 0, 0);
|
||||
}, '`Atomics.notify(new TA(buffer), 0, 0)` throws TypeError');
|
||||
}, floatArrayConstructors);
|
||||
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
/*---
|
||||
esid: sec-atomics.notify
|
||||
description: >
|
||||
Return abrupt when ToInteger throws for 'index' argument to Atomics.wake
|
||||
Return abrupt when ToInteger throws for 'index' argument to Atomics.notify
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, value, timeout )
|
||||
Atomics.notify( typedArray, index, value, timeout )
|
||||
|
||||
2. Let i be ? ValidateAtomicAccess(typedArray, index).
|
||||
|
||||
@ -45,17 +45,17 @@ const poisonedToPrimitive = {
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Atomics.wake(i32a, poisonedValueOf, poisonedValueOf);
|
||||
}, '`Atomics.wake(i32a, poisonedValueOf, poisonedValueOf)` throws Test262Error');
|
||||
Atomics.notify(i32a, poisonedValueOf, poisonedValueOf);
|
||||
}, '`Atomics.notify(i32a, poisonedValueOf, poisonedValueOf)` throws Test262Error');
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Atomics.wake(i32a, poisonedToPrimitive, poisonedToPrimitive);
|
||||
}, '`Atomics.wake(i32a, poisonedToPrimitive, poisonedToPrimitive)` throws Test262Error');
|
||||
Atomics.notify(i32a, poisonedToPrimitive, poisonedToPrimitive);
|
||||
}, '`Atomics.notify(i32a, poisonedToPrimitive, poisonedToPrimitive)` throws Test262Error');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i32a, Symbol("foo"), poisonedValueOf);
|
||||
}, '`Atomics.wake(i32a, Symbol("foo"), poisonedValueOf)` throws TypeError');
|
||||
Atomics.notify(i32a, Symbol("foo"), poisonedValueOf);
|
||||
}, '`Atomics.notify(i32a, Symbol("foo"), poisonedValueOf)` throws TypeError');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wake(i32a, Symbol("foo"), poisonedToPrimitive);
|
||||
}, '`Atomics.wake(i32a, Symbol("foo"), poisonedToPrimitive)` throws TypeError');
|
||||
Atomics.notify(i32a, Symbol("foo"), poisonedToPrimitive);
|
||||
}, '`Atomics.notify(i32a, Symbol("foo"), poisonedToPrimitive)` throws TypeError');
|
||||
|
@ -6,7 +6,7 @@ esid: sec-atomics.notify
|
||||
description: >
|
||||
An undefined index arg should translate to 0
|
||||
info: |
|
||||
Atomics.wake( typedArray, index, count )
|
||||
Atomics.notify( typedArray, index, count )
|
||||
|
||||
2.Let i be ? ValidateAtomicAccess(typedArray, index).
|
||||
...
|
||||
@ -60,14 +60,14 @@ $262.agent.tryYield();
|
||||
|
||||
// Wake at index 0, undefined => 0.
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i32a, undefined, 1)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.wake(i32a, undefined, 1) returns 1');
|
||||
while ((woken = Atomics.notify(i32a, undefined, 1)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.notify(i32a, undefined, 1) returns 1');
|
||||
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
||||
// Wake again at index 0, default => 0.
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i32a, /*, default values used */)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.wake(i32a /*, default values used */) returns 1');
|
||||
while ((woken = Atomics.notify(i32a, /*, default values used */)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.notify(i32a /*, default values used */) returns 1');
|
||||
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
Loading…
x
Reference in New Issue
Block a user