rest-params-trailing-comma-early-error.js (1711B)
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/arrow-function.template 5 /*--- 6 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (arrow function expression) 7 esid: sec-arrow-function-definitions-runtime-semantics-evaluation 8 flags: [generated] 9 negative: 10 phase: parse 11 type: SyntaxError 12 info: | 13 ArrowFunction : ArrowParameters => ConciseBody 14 15 [...] 16 4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict). 17 [...] 18 19 9.2.1 [[Call]] ( thisArgument, argumentsList) 20 21 [...] 22 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). 23 [...] 24 25 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 26 27 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). 28 [...] 29 30 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) 31 32 [...] 33 23. Let iteratorRecord be Record {[[iterator]]: 34 CreateListIterator(argumentsList), [[done]]: false}. 35 24. If hasDuplicates is true, then 36 [...] 37 25. Else, 38 b. Let formalStatus be IteratorBindingInitialization for formals with 39 iteratorRecord and env as arguments. 40 [...] 41 42 Trailing comma in the parameters list 43 44 14.1 Function Definitions 45 46 FormalParameters[Yield, Await] : 47 [empty] 48 FunctionRestParameter[?Yield, ?Await] 49 FormalParameterList[?Yield, ?Await] 50 FormalParameterList[?Yield, ?Await] , 51 FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await] 52 ---*/ 53 $DONOTEVALUATE(); 54 55 0, (...a,) => { 56 57 };