dflt-params-rest.js (2699B)
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-gen-meth-static.template 5 /*--- 6 description: RestParameter does not support an initializer (static class expression generator method) 7 esid: sec-class-definitions-runtime-semantics-evaluation 8 features: [default-parameters, generators] 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 b. Else, 27 Let status be the result of performing PropertyDefinitionEvaluation 28 for m with arguments F and false. 29 [...] 30 31 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation 32 33 GeneratorMethod : 34 * PropertyName ( StrictFormalParameters ) { GeneratorBody } 35 36 1. Let propKey be the result of evaluating PropertyName. 37 2. ReturnIfAbrupt(propKey). 38 3. If the function code for this GeneratorMethod is strict mode code, 39 let strict be true. Otherwise let strict be false. 40 4. Let scope be the running execution context's LexicalEnvironment. 41 5. Let closure be GeneratorFunctionCreate(Method, 42 StrictFormalParameters, GeneratorBody, scope, strict). 43 44 9.2.1 [[Call]] ( thisArgument, argumentsList) 45 46 [...] 47 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). 48 [...] 49 50 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 51 52 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). 53 [...] 54 55 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) 56 57 [...] 58 23. Let iteratorRecord be Record {[[iterator]]: 59 CreateListIterator(argumentsList), [[done]]: false}. 60 24. If hasDuplicates is true, then 61 [...] 62 25. Else, 63 b. Let formalStatus be IteratorBindingInitialization for formals with 64 iteratorRecord and env as arguments. 65 [...] 66 67 68 14.1 Function Definitions 69 70 Syntax 71 72 FunctionRestParameter[Yield] : 73 74 BindingRestElement[?Yield] 75 76 13.3.3 Destructuring Binding Patterns 77 78 Syntax 79 80 BindingRestElement[Yield] : 81 82 ...BindingIdentifier[?Yield] 83 ...BindingPattern[?Yield] 84 85 ---*/ 86 $DONOTEVALUATE(); 87 88 0, class { 89 static *method(...x = []) { 90 91 } 92 };