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