dflt-params-rest.js (1714B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/function-forms/dflt-params-rest.case 4 // - src/function-forms/syntax/gen-func-decl.template 5 /*--- 6 description: RestParameter does not support an initializer (generator function declaration) 7 esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject 8 features: [default-parameters, generators] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody } 15 16 [...] 17 2. Let F be GeneratorFunctionCreate(Normal, FormalParameters, 18 GeneratorBody, scope, strict). 19 [...] 20 21 9.2.1 [[Call]] ( thisArgument, argumentsList) 22 23 [...] 24 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). 25 [...] 26 27 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 28 29 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). 30 [...] 31 32 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) 33 34 [...] 35 23. Let iteratorRecord be Record {[[iterator]]: 36 CreateListIterator(argumentsList), [[done]]: false}. 37 24. If hasDuplicates is true, then 38 [...] 39 25. Else, 40 b. Let formalStatus be IteratorBindingInitialization for formals with 41 iteratorRecord and env as arguments. 42 [...] 43 44 45 14.1 Function Definitions 46 47 Syntax 48 49 FunctionRestParameter[Yield] : 50 51 BindingRestElement[?Yield] 52 53 13.3.3 Destructuring Binding Patterns 54 55 Syntax 56 57 BindingRestElement[Yield] : 58 59 ...BindingIdentifier[?Yield] 60 ...BindingPattern[?Yield] 61 62 ---*/ 63 $DONOTEVALUATE(); 64 65 function* f(...x = []) { 66 67 }