| 1 |
// Copyright (C) 2017 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
path: language/statements/async-generator/dstr- |
| 6 |
name: async generator function declaration |
| 7 |
esid: sec-asyncgenerator-definitions-instantiatefunctionobject |
| 8 |
features: [async-iteration] |
| 9 |
info: | |
| 10 |
AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier |
| 11 |
( FormalParameters ) { AsyncGeneratorBody } |
| 12 |
|
| 13 |
[...] |
| 14 |
3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody, |
| 15 |
scope, strict). |
| 16 |
[...] |
| 17 |
flags: [async] |
| 18 |
---*/ |
| 19 |
|
| 20 |
var callCount = 0; |
| 21 |
async function* f(/*{ elems }*/) { |
| 22 |
/*{ body }*/ |
| 23 |
callCount = callCount + 1; |
| 24 |
}; |
| 25 |
f(/*{ vals }*/).next().then(() => { |
| 26 |
assert.sameValue(callCount, 1, 'invoked exactly once'); |
| 27 |
}).then($DONE, $DONE); |