| 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/expressions/async-generator/named- |
| 6 |
name: Async generator named expression - valid for non-strict only cases |
| 7 |
esid: prod-AsyncGeneratorExpression |
| 8 |
info: | |
| 9 |
Async Generator Function Definitions |
| 10 |
|
| 11 |
AsyncGeneratorExpression : |
| 12 |
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) { |
| 13 |
AsyncGeneratorBody } |
| 14 |
features: [async-iteration] |
| 15 |
---*/ |
| 16 |
|
| 17 |
var callCount = 0; |
| 18 |
|
| 19 |
var gen = async function *g() { |
| 20 |
callCount += 1; |
| 21 |
/*{ body }*/ |
| 22 |
}; |
| 23 |
|
| 24 |
var iter = gen(); |
| 25 |
|
| 26 |
/*{ assertions }*/ |
| 27 |
|
| 28 |
assert.sameValue(callCount, 1); |