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