| // Copyright (C) 2020 Rick Waldron. All rights reserved. | |
| // This code is governed by the BSD license found in the LICENSE file. | |
| /*--- | |
| path: language/expressions/async-generator/named-no-strict- | |
| name: async generator named function expression in non-strict mode code | |
| esid: sec-asyncgenerator-definitions-evaluation | |
| info: | | |
| AsyncGeneratorExpression : | |
| async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } | |
| features: [async-iteration] | |
| flags: [async, noStrict] | |
| includes: [asyncHelpers.js] | |
| ---*/ | |
| // increment callCount in case "body" | |
| let callCount = 0; | |
| let ref = async function * BindingIdentifier() { | |
| /*{ body }*/ | |
| }; | |
| asyncTest(async () => { | |
| assert.sameValue((await (await ref()).next()).value, ref); | |
| assert.sameValue(callCount, 1, 'function invoked exactly once'); | |
| }); | |