array-destructuring-param-strict-body.js (5715B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/function-forms/array-destructuring-param-strict-body.case 4 // - src/function-forms/syntax/cls-expr-async-gen-meth-static.template 5 /*--- 6 description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression async generator method) 7 esid: sec-class-definitions-runtime-semantics-evaluation 8 features: [rest-parameters, async-iteration] 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 Runtime Semantics: PropertyDefinitionEvaluation 32 33 AsyncGeneratorMethod : 34 async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) 35 { AsyncGeneratorBody } 36 37 1. Let propKey be the result of evaluating PropertyName. 38 2. ReturnIfAbrupt(propKey). 39 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. 40 Otherwise let strict be false. 41 4. Let scope be the running execution context's LexicalEnvironment. 42 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, 43 AsyncGeneratorBody, scope, strict). 44 [...] 45 46 47 13.3.3.4 Static Semantics: IsSimpleParameterList 48 49 BindingElement : BindingPattern 50 51 1. Return false. 52 53 14.1.2 Static Semantics: Early Errors 54 55 FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } 56 FunctionDeclaration : function ( FormalParameters ) { FunctionBody } 57 FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody } 58 59 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 60 IsSimpleParameterList of FormalParameters is false. 61 62 14.2.1 Static Semantics: Early Errors 63 64 ArrowFunction : ArrowParameters => ConciseBody 65 66 - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and 67 IsSimpleParameterList of ArrowParameters is false. 68 69 14.3.1 Static Semantics: Early Errors 70 71 MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody } 72 73 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 74 IsSimpleParameterList of UniqueFormalParameters is false. 75 76 MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody } 77 78 - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and 79 IsSimpleParameterList of PropertySetParameterList is false. 80 81 14.4.1 Static Semantics: Early Errors 82 83 GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody } 84 85 - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and 86 IsSimpleParameterList of UniqueFormalParameters is false. 87 88 GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 89 GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody } 90 GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 91 92 - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and 93 IsSimpleParameterList of UniqueFormalParameters is false. 94 95 14.5.1 Static Semantics: Early Errors 96 97 AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } 98 99 - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and 100 IsSimpleParameterList of UniqueFormalParameters is false. 101 102 AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } 103 AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody } 104 AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } 105 106 - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and 107 IsSimpleParameterList of FormalParameters is false. 108 109 14.7.1 Static Semantics: Early Errors 110 111 AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } 112 113 - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and 114 IsSimpleParameterList of UniqueFormalParameters is false. 115 116 AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } 117 AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody } 118 AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } 119 AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } 120 121 - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and 122 IsSimpleParameterList of FormalParameters is false. 123 124 14.8.1 Static Semantics: Early Errors 125 126 AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody 127 128 - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and 129 IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false. 130 131 ---*/ 132 $DONOTEVALUATE(); 133 134 0, class { 135 static async *method([element]) { 136 "use strict"; 137 } 138 };