mirror of
https://github.com/tc39/test262.git
synced 2025-07-01 11:14:52 +02:00
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);
|
const i32a = new Int32Array(sab);
|
||||||
Atomics.add(i32a, ${RUNNING}, 1);
|
Atomics.add(i32a, ${RUNNING}, 1);
|
||||||
|
|
||||||
const status1 = await Atomics.waitAsync(i32a, 0, 0, false);
|
const status1 = await Atomics.waitAsync(i32a, 0, 0, false).value;
|
||||||
const status2 = await Atomics.waitAsync(i32a, 0, 0, valueOf);
|
const status2 = await Atomics.waitAsync(i32a, 0, 0, valueOf).value;
|
||||||
const status3 = await Atomics.waitAsync(i32a, 0, 0, toPrimitive);
|
const status3 = await Atomics.waitAsync(i32a, 0, 0, toPrimitive).value;
|
||||||
|
|
||||||
$262.agent.report(status1);
|
$262.agent.report(status1);
|
||||||
$262.agent.report(status2);
|
$262.agent.report(status2);
|
||||||
|
@ -14,7 +14,7 @@ info: |
|
|||||||
|
|
||||||
6. Let q be ? ToNumber(timeout).
|
6. Let q be ? ToNumber(timeout).
|
||||||
|
|
||||||
flags: [async, CanBlockIsTrue]
|
flags: [async]
|
||||||
includes: [atomicsHelper.js]
|
includes: [atomicsHelper.js]
|
||||||
features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics]
|
features: [Atomics.waitAsync, SharedArrayBuffer, TypedArray, Atomics]
|
||||||
---*/
|
---*/
|
||||||
@ -34,25 +34,12 @@ const toPrimitive = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
(async () => {
|
Promise.all([
|
||||||
try {
|
Atomics.waitAsync(i32a, 0, 0, false).value,
|
||||||
assert.sameValue(
|
Atomics.waitAsync(i32a, 0, 0, valueOf).value,
|
||||||
await Atomics.waitAsync(i32a, 0, 0, false),
|
Atomics.waitAsync(i32a, 0, 0, toPrimitive).value,
|
||||||
'timed-out',
|
]).then(outcomes => {
|
||||||
'Atomics.waitAsync(i32a, 0, 0, false) returns "timed-out"'
|
assert.sameValue(outcomes[0], "timed-out");
|
||||||
);
|
assert.sameValue(outcomes[0], "timed-out");
|
||||||
assert.sameValue(
|
assert.sameValue(outcomes[0], "timed-out");
|
||||||
await Atomics.waitAsync(i32a, 0, 0, valueOf),
|
}, $DONE).then($DONE, $DONE);
|
||||||
'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);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user