| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/async-generators/yield-identifier-strict.case |
| 3 |
// - src/async-generators/default/async-expression.template |
| 4 |
/*--- |
| 5 |
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Unnamed async generator expression) |
| 6 |
esid: prod-AsyncGeneratorExpression |
| 7 |
features: [async-iteration] |
| 8 |
flags: [generated, onlyStrict] |
| 9 |
negative: |
| 10 |
phase: parse |
| 11 |
type: SyntaxError |
| 12 |
info: | |
| 13 |
Async Generator Function Definitions |
| 14 |
|
| 15 |
AsyncGeneratorExpression : |
| 16 |
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) { |
| 17 |
AsyncGeneratorBody } |
| 18 |
|
| 19 |
---*/ |
| 20 |
throw "Test262: This statement should not be evaluated."; |
| 21 |
|
| 22 |
|
| 23 |
var callCount = 0; |
| 24 |
|
| 25 |
var gen = async function *() { |
| 26 |
callCount += 1; |
| 27 |
(function() { |
| 28 |
var yield; |
| 29 |
throw new Test262Error(); |
| 30 |
}()) |
| 31 |
}; |
| 32 |
|
| 33 |
var iter = gen(); |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
assert.sameValue(callCount, 1); |