| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/function-forms/rest-params-trailing-comma-early-error.case |
| 3 |
// - src/function-forms/syntax/async-gen-func-expr.template |
| 4 |
/*--- |
| 5 |
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (async generator function expression) |
| 6 |
esid: sec-asyncgenerator-definitions-evaluation |
| 7 |
features: [async-iteration] |
| 8 |
flags: [generated] |
| 9 |
negative: |
| 10 |
phase: parse |
| 11 |
type: SyntaxError |
| 12 |
info: | |
| 13 |
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { |
| 14 |
AsyncGeneratorBody } |
| 15 |
|
| 16 |
[...] |
| 17 |
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, |
| 18 |
AsyncGeneratorBody, scope, strict). |
| 19 |
[...] |
| 20 |
|
| 21 |
|
| 22 |
Trailing comma in the parameters list |
| 23 |
|
| 24 |
14.1 Function Definitions |
| 25 |
|
| 26 |
FormalParameters[Yield, Await] : |
| 27 |
[empty] |
| 28 |
FunctionRestParameter[?Yield, ?Await] |
| 29 |
FormalParameterList[?Yield, ?Await] |
| 30 |
FormalParameterList[?Yield, ?Await] , |
| 31 |
FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await] |
| 32 |
---*/ |
| 33 |
throw "Test262: This statement should not be evaluated."; |
| 34 |
|
| 35 |
|
| 36 |
0, async function*(...a,) { |
| 37 |
|
| 38 |
}; |