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