mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +02:00
Atomics.waitAsync: await $262.agent.getReportAsync() in a loop, instead of calling thrice asynchronously. Fixes 2664 (#2676)
This commit is contained in:
parent
a2b45dd33b
commit
fcb3b91e4a
@ -11,7 +11,6 @@ features: [Atomics.waitAsync, Atomics, BigInt]
|
|||||||
---*/
|
---*/
|
||||||
assert.sameValue(typeof Atomics.waitAsync, 'function');
|
assert.sameValue(typeof Atomics.waitAsync, 'function');
|
||||||
|
|
||||||
|
|
||||||
$262.agent.start(`
|
$262.agent.start(`
|
||||||
(async () => {
|
(async () => {
|
||||||
var sab = new SharedArrayBuffer(2048);
|
var sab = new SharedArrayBuffer(2048);
|
||||||
@ -45,11 +44,12 @@ $262.agent.start(`
|
|||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
||||||
Promise.all([
|
(async () => {
|
||||||
$262.agent.getReportAsync(),
|
const outcomes = [];
|
||||||
$262.agent.getReportAsync(),
|
|
||||||
$262.agent.getReportAsync(),
|
for (let i = 0; i < 3; i++) {
|
||||||
]).then(outcomes => {
|
outcomes.push(await $262.agent.getReportAsync());
|
||||||
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
outcomes[0],
|
outcomes[0],
|
||||||
@ -67,6 +67,4 @@ Promise.all([
|
|||||||
'C not-equal,not-equal,not-equal,not-equal,not-equal',
|
'C not-equal,not-equal,not-equal,not-equal,not-equal',
|
||||||
'All C values are not equal'
|
'All C values are not equal'
|
||||||
);
|
);
|
||||||
}).then($DONE, $DONE);
|
})().then($DONE, $DONE);
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ features: [Atomics.waitAsync, Atomics]
|
|||||||
---*/
|
---*/
|
||||||
assert.sameValue(typeof Atomics.waitAsync, 'function');
|
assert.sameValue(typeof Atomics.waitAsync, 'function');
|
||||||
|
|
||||||
|
|
||||||
$262.agent.start(`
|
$262.agent.start(`
|
||||||
(async () => {
|
(async () => {
|
||||||
var sab = new SharedArrayBuffer(1024);
|
var sab = new SharedArrayBuffer(1024);
|
||||||
@ -44,11 +43,12 @@ $262.agent.start(`
|
|||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
||||||
Promise.all([
|
(async () => {
|
||||||
$262.agent.getReportAsync(),
|
const outcomes = [];
|
||||||
$262.agent.getReportAsync(),
|
|
||||||
$262.agent.getReportAsync(),
|
for (let i = 0; i < 3; i++) {
|
||||||
]).then(outcomes => {
|
outcomes.push(await $262.agent.getReportAsync());
|
||||||
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
outcomes[0],
|
outcomes[0],
|
||||||
@ -66,5 +66,4 @@ Promise.all([
|
|||||||
'C not-equal,not-equal,not-equal,not-equal,not-equal',
|
'C not-equal,not-equal,not-equal,not-equal,not-equal',
|
||||||
'All C values are not equal'
|
'All C values are not equal'
|
||||||
);
|
);
|
||||||
}).then($DONE, $DONE);
|
})().then($DONE, $DONE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user