mirror of https://github.com/tc39/test262.git
Atomics.waitAsync: false for timeouts, revised.
This commit is contained in:
parent
9519cd8448
commit
677fb82a75
|
@ -36,9 +36,9 @@ $262.agent.start(`
|
|||
const i32a = new Int32Array(sab);
|
||||
Atomics.add(i32a, ${RUNNING}, 1);
|
||||
|
||||
const status1 = await Atomics.waitAsync(i32a, 0, 0, false);
|
||||
const status2 = await Atomics.waitAsync(i32a, 0, 0, valueOf);
|
||||
const status3 = await Atomics.waitAsync(i32a, 0, 0, toPrimitive);
|
||||
const status1 = await Atomics.waitAsync(i32a, 0, 0, false).value;
|
||||
const status2 = await Atomics.waitAsync(i32a, 0, 0, valueOf).value;
|
||||
const status3 = await Atomics.waitAsync(i32a, 0, 0, toPrimitive).value;
|
||||
|
||||
$262.agent.report(status1);
|
||||
$262.agent.report(status2);
|
||||
|
|
|
@ -14,7 +14,7 @@ info: |
|
|||
|
||||
6. Let q be ? ToNumber(timeout).
|
||||
|
||||
flags: [async, CanBlockIsTrue]
|
||||
flags: [async]
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics]
|
||||
---*/
|
||||
|
@ -34,25 +34,12 @@ const toPrimitive = {
|
|||
}
|
||||
};
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
assert.sameValue(
|
||||
await Atomics.waitAsync(i32a, 0, 0, false),
|
||||
'timed-out',
|
||||
'Atomics.waitAsync(i32a, 0, 0, false) returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(
|
||||
await Atomics.waitAsync(i32a, 0, 0, valueOf),
|
||||
'timed-out',
|
||||
'Atomics.waitAsync(i32a, 0, 0, valueOf) returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(
|
||||
await Atomics.waitAsync(i32a, 0, 0, toPrimitive),
|
||||
'timed-out',
|
||||
'Atomics.waitAsync(i32a, 0, 0, toPrimitive) returns "timed-out"'
|
||||
);
|
||||
$DONE();
|
||||
} catch (error) {
|
||||
$DONE(error);
|
||||
}
|
||||
})();
|
||||
Promise.all([
|
||||
Atomics.waitAsync(i32a, 0, 0, false).value,
|
||||
Atomics.waitAsync(i32a, 0, 0, valueOf).value,
|
||||
Atomics.waitAsync(i32a, 0, 0, toPrimitive).value,
|
||||
]).then(outcomes => {
|
||||
assert.sameValue(outcomes[0], "timed-out");
|
||||
assert.sameValue(outcomes[0], "timed-out");
|
||||
assert.sameValue(outcomes[0], "timed-out");
|
||||
}, $DONE).then($DONE, $DONE);
|
||||
|
|
Loading…
Reference in New Issue