rest-param-strict-body.js (5528B)
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-decl-async-meth.template 5 /*--- 6 description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (class declaration async method) 7 esid: sec-class-definitions-runtime-semantics-evaluation 8 features: [rest-parameters] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 ClassDeclaration : class BindingIdentifier ClassTail 15 16 1. Let className be StringValue of BindingIdentifier. 17 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with 18 argument className. 19 [...] 20 21 14.5.14 Runtime Semantics: ClassDefinitionEvaluation 22 23 21. For each ClassElement m in order from methods 24 a. If IsStatic of m is false, then 25 i. Let status be the result of performing 26 PropertyDefinitionEvaluation for m with arguments proto and 27 false. 28 [...] 29 30 Runtime Semantics: PropertyDefinitionEvaluation 31 32 AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } 33 34 1. Let propKey be the result of evaluating PropertyName. 35 2. ReturnIfAbrupt(propKey). 36 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise 37 let strict be false. 38 4. Let scope be the LexicalEnvironment of the running execution context. 39 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody, 40 scope, strict). 41 [...] 42 43 44 14.1.13 Static Semantics: IsSimpleParameterList 45 46 FormalParameters : FormalParameterList , FunctionRestParameter 47 48 1. Return false. 49 50 14.1.2 Static Semantics: Early Errors 51 52 FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } 53 FunctionDeclaration : function ( FormalParameters ) { FunctionBody } 54 FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody } 55 56 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 57 IsSimpleParameterList of FormalParameters is false. 58 59 14.2.1 Static Semantics: Early Errors 60 61 ArrowFunction : ArrowParameters => ConciseBody 62 63 - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and 64 IsSimpleParameterList of ArrowParameters is false. 65 66 14.3.1 Static Semantics: Early Errors 67 68 MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody } 69 70 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 71 IsSimpleParameterList of UniqueFormalParameters is false. 72 73 MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody } 74 75 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 76 IsSimpleParameterList of PropertySetParameterList is false. 77 78 14.4.1 Static Semantics: Early Errors 79 80 GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody } 81 82 - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and 83 IsSimpleParameterList of UniqueFormalParameters is false. 84 85 GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 86 GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody } 87 GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 88 89 - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and 90 IsSimpleParameterList of UniqueFormalParameters is false. 91 92 14.5.1 Static Semantics: Early Errors 93 94 AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } 95 96 - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and 97 IsSimpleParameterList of UniqueFormalParameters is false. 98 99 AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } 100 AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody } 101 AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } 102 103 - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and 104 IsSimpleParameterList of FormalParameters is false. 105 106 14.7.1 Static Semantics: Early Errors 107 108 AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } 109 110 - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and 111 IsSimpleParameterList of UniqueFormalParameters is false. 112 113 AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } 114 AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody } 115 AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } 116 AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } 117 118 - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and 119 IsSimpleParameterList of FormalParameters is false. 120 121 14.8.1 Static Semantics: Early Errors 122 123 AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody 124 125 - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and 126 IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false. 127 128 ---*/ 129 $DONOTEVALUATE(); 130 131 132 class C { 133 async method(a,...rest) { 134 "use strict"; 135 } 136 }