rest-param-strict-body.js (6302B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/function-forms/rest-param-strict-body.case 4 // - src/function-forms/syntax/cls-expr-gen-meth-static.template 5 /*--- 6 description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (static class expression generator method) 7 esid: sec-class-definitions-runtime-semantics-evaluation 8 features: [rest-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.13 Static Semantics: IsSimpleParameterList 69 70 FormalParameters : FormalParameterList , FunctionRestParameter 71 72 1. Return false. 73 74 14.1.2 Static Semantics: Early Errors 75 76 FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } 77 FunctionDeclaration : function ( FormalParameters ) { FunctionBody } 78 FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody } 79 80 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 81 IsSimpleParameterList of FormalParameters is false. 82 83 14.2.1 Static Semantics: Early Errors 84 85 ArrowFunction : ArrowParameters => ConciseBody 86 87 - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and 88 IsSimpleParameterList of ArrowParameters is false. 89 90 14.3.1 Static Semantics: Early Errors 91 92 MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody } 93 94 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 95 IsSimpleParameterList of UniqueFormalParameters is false. 96 97 MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody } 98 99 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 100 IsSimpleParameterList of PropertySetParameterList is false. 101 102 14.4.1 Static Semantics: Early Errors 103 104 GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody } 105 106 - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and 107 IsSimpleParameterList of UniqueFormalParameters is false. 108 109 GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 110 GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody } 111 GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 112 113 - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and 114 IsSimpleParameterList of UniqueFormalParameters is false. 115 116 14.5.1 Static Semantics: Early Errors 117 118 AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } 119 120 - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and 121 IsSimpleParameterList of UniqueFormalParameters is false. 122 123 AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } 124 AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody } 125 AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } 126 127 - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and 128 IsSimpleParameterList of FormalParameters is false. 129 130 14.7.1 Static Semantics: Early Errors 131 132 AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } 133 134 - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and 135 IsSimpleParameterList of UniqueFormalParameters is false. 136 137 AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } 138 AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody } 139 AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } 140 AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } 141 142 - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and 143 IsSimpleParameterList of FormalParameters is false. 144 145 14.8.1 Static Semantics: Early Errors 146 147 AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody 148 149 - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and 150 IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false. 151 152 ---*/ 153 $DONOTEVALUATE(); 154 155 0, class { 156 static *method(a,...rest) { 157 "use strict"; 158 } 159 };