| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/async-generators/yield-identifier-spread-strict.case |
| 3 |
// - src/async-generators/default/async-expression.template |
| 4 |
/*--- |
| 5 |
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Unnamed async generator expression) |
| 6 |
esid: prod-AsyncGeneratorExpression |
| 7 |
features: [object-spread, 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 |
Spread Properties |
| 21 |
|
| 22 |
PropertyDefinition[Yield]: |
| 23 |
(...) |
| 24 |
...AssignmentExpression[In, ?Yield] |
| 25 |
|
| 26 |
---*/ |
| 27 |
throw "Test262: This statement should not be evaluated."; |
| 28 |
|
| 29 |
|
| 30 |
var callCount = 0; |
| 31 |
|
| 32 |
var gen = async function *() { |
| 33 |
callCount += 1; |
| 34 |
return { |
| 35 |
...(function() { |
| 36 |
var yield; |
| 37 |
throw new Test262Error(); |
| 38 |
}()), |
| 39 |
} |
| 40 |
}; |
| 41 |
|
| 42 |
var iter = gen(); |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
assert.sameValue(callCount, 1); |