dflt-params-rest.js (2481B)
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/cls-expr-meth.template 5 /*--- 6 description: RestParameter does not support an initializer (class expression method) 7 esid: sec-class-definitions-runtime-semantics-evaluation 8 features: [default-parameters] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 ClassExpression : class BindingIdentifieropt ClassTail 15 16 1. If BindingIdentifieropt is not present, let className be undefined. 17 2. Else, let className be StringValue of BindingIdentifier. 18 3. Let value be the result of ClassDefinitionEvaluation of ClassTail 19 with argument className. 20 [...] 21 22 14.5.14 Runtime Semantics: ClassDefinitionEvaluation 23 24 21. For each ClassElement m in order from methods 25 a. If IsStatic of m is false, then 26 i. Let status be the result of performing 27 PropertyDefinitionEvaluation for m with arguments proto and 28 false. 29 [...] 30 31 14.3.8 Runtime Semantics: DefineMethod 32 33 MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody } 34 35 [...] 36 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody, 37 scope, strict). If functionPrototype was passed as a parameter then pass its 38 value as the functionPrototype optional argument of FunctionCreate. 39 [...] 40 41 9.2.1 [[Call]] ( thisArgument, argumentsList) 42 43 [...] 44 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). 45 [...] 46 47 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 48 49 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). 50 [...] 51 52 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) 53 54 [...] 55 23. Let iteratorRecord be Record {[[iterator]]: 56 CreateListIterator(argumentsList), [[done]]: false}. 57 24. If hasDuplicates is true, then 58 [...] 59 25. Else, 60 b. Let formalStatus be IteratorBindingInitialization for formals with 61 iteratorRecord and env as arguments. 62 [...] 63 64 14.1 Function Definitions 65 66 Syntax 67 68 FunctionRestParameter[Yield] : 69 70 BindingRestElement[?Yield] 71 72 13.3.3 Destructuring Binding Patterns 73 74 Syntax 75 76 BindingRestElement[Yield] : 77 78 ...BindingIdentifier[?Yield] 79 ...BindingPattern[?Yield] 80 81 ---*/ 82 $DONOTEVALUATE(); 83 84 0, class { 85 method(...x = []) { 86 87 } 88 };