Refactor simple cases of (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest

This commit is contained in:
Cam Tenny 2022-12-29 17:08:39 -08:00 committed by Philip Chimento
parent 1d116b48a9
commit 4d9d5c570d
53 changed files with 116 additions and 65 deletions

View File

@ -12,6 +12,7 @@ info: |
flags: [async, noStrict]
features: [async-functions]
includes: [asyncHelpers.js]
---*/
// increment callCount in case "body"
@ -20,8 +21,8 @@ let ref = async function BindingIdentifier() {
/*{ body }*/
};
(async () => {
asyncTest(async () => {
assert.sameValue(await ref(), ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

View File

@ -12,6 +12,7 @@ info: |
features: [async-functions]
flags: [async, onlyStrict]
includes: [asyncHelpers.js]
---*/
// increment callCount in case "body"
@ -20,7 +21,7 @@ let ref = async function BindingIdentifier() {
/*{ body }*/
};
(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
await ref()
@ -30,5 +31,5 @@ let ref = async function BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

View File

@ -10,6 +10,7 @@ info: |
features: [async-iteration]
flags: [async, noStrict]
includes: [asyncHelpers.js]
---*/
// increment callCount in case "body"
@ -18,8 +19,8 @@ let ref = async function * BindingIdentifier() {
/*{ body }*/
};
(async () => {
asyncTest(async () => {
assert.sameValue((await (await ref()).next()).value, ref);
assert.sameValue(callCount, 1, 'function invoked exactly once');
})().then($DONE, $DONE);
});

View File

@ -10,6 +10,7 @@ info: |
features: [async-iteration]
flags: [async, onlyStrict]
includes: [asyncHelpers.js]
---*/
// increment callCount in case "body"
@ -18,7 +19,7 @@ let ref = async function * BindingIdentifier() {
/*{ body }*/
};
(async () => {
asyncTest(async () => {
let catchCount = 0;
try {
(await (await ref()).next()).value
@ -28,5 +29,5 @@ let ref = async function * BindingIdentifier() {
}
assert.sameValue(catchCount, 1);
assert.sameValue(callCount, 1);
})().then($DONE, $DONE);
});

View File

@ -16,6 +16,7 @@ info: |
[...]
flags: [async]
features: [async-iteration]
includes: [asyncHelpers.js]
---*/
var nextArgumentsLength;
@ -29,8 +30,8 @@ var syncIterator = {
},
};
(async function () {
asyncTest(async function () {
for await (let _ of syncIterator);
assert.sameValue(nextArgumentsLength, 0);
})().then($DONE, $DONE);
});

View File

@ -16,6 +16,7 @@ info: |
[...]
flags: [async]
features: [async-iteration]
includes: [asyncHelpers.js]
---*/
var returnArgumentsLength;
@ -32,10 +33,10 @@ var syncIterator = {
},
};
(async function () {
asyncTest(async function () {
for await (let _ of syncIterator) {
break;
}
assert.sameValue(returnArgumentsLength, 0);
})().then($DONE, $DONE);
});

View File

@ -24,6 +24,7 @@ info: |
3. If func is either undefined or null, return undefined.
flags: [async]
features: [async-iteration]
includes: [asyncHelpers.js]
---*/
var iterationCount = 0;
@ -42,7 +43,7 @@ var syncIterator = {
},
};
(async function() {
asyncTest(async function() {
for await (let _ of syncIterator) {
iterationCount += 1;
break;
@ -50,4 +51,4 @@ var syncIterator = {
assert.sameValue(iterationCount, 1);
assert.sameValue(returnGets, 1);
}()).then($DONE, $DONE);
});

View File

@ -27,6 +27,7 @@ info: >
flags: [async]
features: [async-iteration]
includes: [asyncHelpers.js]
---*/
var yieldorder = 0;
@ -58,7 +59,7 @@ async function awaitnexts() {
assert.sameValue((await item1).value, 1)
}
awaitnexts().then($DONE, $DONE);
asyncTest(awaitnexts);
// At this point:
// yieldorder == 0

View File

@ -6,7 +6,7 @@ esid: sec-atomics.waitasync
description: >
Test Atomics.waitAsync on arrays that allow atomic operations
flags: [async]
includes: [atomicsHelper.js]
includes: [atomicsHelper.js, asyncHelpers.js]
features: [Atomics.waitAsync, Atomics, BigInt]
---*/
assert.sameValue(typeof Atomics.waitAsync, 'function', 'The value of `typeof Atomics.waitAsync` is "function"');
@ -44,7 +44,7 @@ $262.agent.start(`
`);
(async () => {
asyncTest(async () => {
const outcomes = [];
for (let i = 0; i < 3; i++) {
@ -67,4 +67,4 @@ $262.agent.start(`
'C not-equal,not-equal,not-equal,not-equal,not-equal',
'The value of outcomes[2] is "C not-equal,not-equal,not-equal,not-equal,not-equal"'
);
})().then($DONE, $DONE);
});

View File

@ -6,7 +6,7 @@ esid: sec-atomics.waitasync
description: >
Test Atomics.waitAsync on arrays that allow atomic operations
flags: [async]
includes: [atomicsHelper.js]
includes: [atomicsHelper.js, asyncHelpers.js]
features: [Atomics.waitAsync, Atomics]
---*/
assert.sameValue(typeof Atomics.waitAsync, 'function', 'The value of `typeof Atomics.waitAsync` is "function"');
@ -43,7 +43,7 @@ $262.agent.start(`
`);
(async () => {
asyncTest(async () => {
const outcomes = [];
for (let i = 0; i < 3; i++) {
@ -66,4 +66,4 @@ $262.agent.start(`
'C not-equal,not-equal,not-equal,not-equal,not-equal',
'The value of outcomes[2] is "C not-equal,not-equal,not-equal,not-equal,not-equal"'
);
})().then($DONE, $DONE);
});

View File

@ -8,6 +8,7 @@ description: >
Await can await any thenable. If the thenable's then is not callable,
await evaluates to the thenable
flags: [async]
includes: [asyncHelpers.js]
---*/
async function foo() {
@ -16,5 +17,5 @@ async function foo() {
assert.sameValue(res, thenable);
}
foo().then($DONE, $DONE);
asyncTest(foo);

View File

@ -7,6 +7,7 @@ esid: pending
description: >
Await can await any thenable.
flags: [async]
includes: [asyncHelpers.js]
---*/
var error = {};
@ -27,5 +28,5 @@ async function foo() {
assert(caught);
}
foo().then($DONE, $DONE);
asyncTest(foo);

View File

@ -7,6 +7,7 @@ esid: pending
description: >
Await can await any thenable.
flags: [async]
includes: [asyncHelpers.js]
---*/
var thenable = {
@ -18,4 +19,4 @@ async function foo() {
assert.sameValue(await thenable, 42);
}
foo().then($DONE, $DONE);
asyncTest(foo);

View File

@ -7,6 +7,7 @@ esid: pending
description: >
Await throws errors from rejected promises
flags: [async]
includes: [asyncHelpers.js]
---*/
async function foo() {
@ -22,4 +23,4 @@ async function foo() {
assert(caught);
}
foo().then($DONE, $DONE);
asyncTest(foo);

View File

@ -7,6 +7,7 @@ esid: pending
description: >
Await's operand is a UnaryExpression
flags: [async]
includes: [asyncHelpers.js]
---*/
async function foo() {
@ -14,4 +15,4 @@ async function foo() {
let y = await Promise.resolve(2) * x
assert.sameValue(y, 4);
}
foo().then($DONE, $DONE);
asyncTest(foo);

View File

@ -7,6 +7,7 @@ esid: pending
description: >
Await's operand is a UnaryExpression
flags: [async]
includes: [asyncHelpers.js]
---*/
async function foo() {
@ -15,4 +16,4 @@ async function foo() {
assert.sameValue(y, 1);
assert.sameValue(x, 2);
}
foo().then($DONE, $DONE);
asyncTest(foo);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
let x = './module-code';
@ -37,4 +38,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -35,4 +36,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
Function.prototype.toString = () => './module-code_FIXTURE.js';
@ -28,4 +29,4 @@ async function fn() {
assert.sameValue(ns.default, 42);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -34,4 +35,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const await = './module-code_FIXTURE.js';
@ -30,4 +31,4 @@ async function fn() {
assert.sameValue(ns1.default, 42);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -25,6 +25,7 @@ info: |
CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = () => () => './module-code_FIXTURE.js';
@ -42,4 +43,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -25,6 +25,7 @@ info: |
CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = () => ['./module-code_FIXTURE.js', './module-code-other_FIXTURE.js'];
@ -41,4 +42,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -25,6 +25,7 @@ info: |
CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = () => ({
@ -44,4 +45,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -25,6 +25,7 @@ info: |
CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = () => './module-code_FIXTURE.js';
@ -42,4 +43,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -20,6 +20,7 @@ info: |
(Expression[+In, ?Yield, ?Await])
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
async function fn() {
@ -34,4 +35,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -34,4 +35,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
let x = './module-code';
@ -37,4 +38,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -18,6 +18,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async, noStrict]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const y = {
@ -33,4 +34,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
let x = 'foo';
@ -38,4 +39,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -35,4 +36,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -34,4 +35,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const obj = {
@ -38,4 +39,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import, new.target]
includes: [asyncHelpers.js]
---*/
function ctor() {
@ -32,4 +33,4 @@ async function fn() {
assert.sameValue(ns.default, 42);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -35,4 +36,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
function tag(arg) {
@ -31,4 +32,4 @@ async function fn() {
assert.sameValue(ns.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -34,4 +35,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -44,4 +45,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const a = './module-code_FIXTURE.js';
@ -44,4 +45,4 @@ async function fn() {
assert.sameValue(ns2.default, 1612);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -17,6 +17,7 @@ info: |
LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
flags: [async, noStrict]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
const yield = './module-code_FIXTURE.js';
@ -28,4 +29,4 @@ async function fn() {
assert.sameValue(ns1.default, 42);
}
fn().then($DONE, $DONE).catch($DONE);
asyncTest(fn);

View File

@ -16,6 +16,7 @@ info: |
f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
async function fn() {
@ -29,4 +30,4 @@ async function fn() {
assert.sameValue(String(value), '42', 'namespace fallsback to valueOf as its prototype is null');
}
fn().then($DONE, $DONE);
asyncTest(fn);

View File

@ -16,6 +16,7 @@ info: |
f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
flags: [async]
features: [dynamic-import, async-iteration]
includes: [asyncHelpers.js]
---*/
async function * agen1() {
@ -66,4 +67,4 @@ async function fn() {
assert.sameValue(error, 'foo', 'f');
}
fn().then($DONE, $DONE);
asyncTest(fn);

View File

@ -16,6 +16,7 @@ info: |
f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
flags: [async]
features: [dynamic-import, async-iteration]
includes: [asyncHelpers.js]
---*/
async function * agen() {
@ -48,4 +49,4 @@ async function fn() {
assert.sameValue(error, 'foo');
}
fn().then($DONE, $DONE);
asyncTest(fn);

View File

@ -29,4 +29,5 @@ async function fn() {
assert.sameValue(imported.y, 1, 'updated value, indirect binding');
}
// Do not use asyncTest: when self imported, $DONE is not defined, asyncTest will throw
fn().then($DONE, $DONE);

View File

@ -16,6 +16,7 @@ info: |
f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
flags: [async]
features: [dynamic-import]
includes: [asyncHelpers.js]
---*/
async function fn() {
@ -28,4 +29,4 @@ async function fn() {
assert.sameValue(other.default, 42);
}
fn().then($DONE, $DONE);
asyncTest(fn);

View File

@ -15,6 +15,7 @@ info: |
NewTarget
features: [new.target, async-functions]
flags: [async]
includes: [asyncHelpers.js]
---*/
(function() { assert.sameValue(delete (new.target), true); })();
@ -26,6 +27,6 @@ new function() { assert.sameValue(~new.target, -1); };
(function() { assert.sameValue(!new.target, true); })();
new function() { assert.sameValue(delete void typeof +-~!(new.target), true); };
(async function() {
asyncTest(async function() {
assert.sameValue(await new.target, undefined);
})().then($DONE, $DONE);
});

View File

@ -9,6 +9,7 @@ info: |
for await (LeftHandSideExpression of AssignmentExpression) Statement
features: [optional-chaining]
flags: [async]
includes: [asyncHelpers.js]
---*/
const obj = {
iterable: {
@ -32,4 +33,4 @@ async function checkAssertions() {
}
assert.sameValue(3, count);
}
checkAssertions().then($DONE, $DONE);
asyncTest(checkAssertions);

View File

@ -10,6 +10,7 @@ info: |
MemberExpression [PrimaryExpression identifier] OptionalChain
features: [optional-chaining]
flags: [async]
includes: [asyncHelpers.js]
---*/
const a = undefined;
@ -29,4 +30,4 @@ async function checkAssertions() {
c.e = Promise.resolve(39);
assert.sameValue(await c?.e, 39, 'await unwraps the promise given after the evaluation of the OCE');
}
checkAssertions().then($DONE, $DONE);
asyncTest(checkAssertions);

View File

@ -10,10 +10,11 @@ info: |
MemberExpression [PrimaryExpression literal] OptionalChain
features: [optional-chaining]
flags: [async]
includes: [asyncHelpers.js]
---*/
async function checkAssertions() {
assert.sameValue(await "hello"?.[0], 'h');
assert.sameValue(await null?.a, undefined);
}
checkAssertions().then($DONE, $DONE);
asyncTest(checkAssertions);

View File

@ -11,6 +11,7 @@ info: |
OptionalChain OptionalChain ?.[Expression]
features: [optional-chaining]
flags: [async]
includes: [asyncHelpers.js]
---*/
async function checkAssertions() {
@ -25,4 +26,4 @@ async function checkAssertions() {
await Promise.reject(new Error('unreachable'))
], undefined);
}
checkAssertions().then($DONE, $DONE);
asyncTest(checkAssertions);

View File

@ -11,6 +11,7 @@ info: |
OptionalChain ?.[Expression]
features: [optional-chaining]
flags: [async]
includes: [asyncHelpers.js]
---*/
async function checkAssertions() {
@ -21,4 +22,4 @@ async function checkAssertions() {
await Promise.reject(new Error('unreachable'))
], undefined);
}
checkAssertions().then($DONE, $DONE);
asyncTest(checkAssertions);

View File

@ -7,6 +7,7 @@ esid: pending
description: >
The this value is set to the global object when not passed in sloppy mode.
flags: [noStrict, async]
includes: [asyncHelpers.js]
---*/
var glob = this;
@ -14,4 +15,4 @@ async function foo() {
assert.sameValue(this, glob);
}
foo().then($DONE, $DONE);
asyncTest(foo);

View File

@ -21,6 +21,7 @@ info: |
3. If func is either undefined or null, return undefined.
features: [Symbol.asyncIterator, async-iteration]
flags: [async]
includes: [asyncHelpers.js]
---*/
var iterationCount = 0;
@ -39,7 +40,7 @@ iterable[Symbol.asyncIterator] = function() {
};
};
(async function() {
asyncTest(async function() {
for await (var _ of iterable) {
iterationCount += 1;
break;
@ -47,4 +48,4 @@ iterable[Symbol.asyncIterator] = function() {
assert.sameValue(iterationCount, 1);
assert.sameValue(returnGets, 1);
}()).then($DONE, $DONE);
});