| 1 |
// |reftest| error:SyntaxError |
| 2 |
// This file was procedurally generated from the following sources: |
| 3 |
// - src/function-forms/object-destructuring-param-strict-body.case |
| 4 |
// - src/function-forms/syntax/cls-decl-async-meth-static.template |
| 5 |
/*--- |
| 6 |
description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class declaration async method) |
| 7 |
esid: sec-runtime-semantics-bindingclassdeclarationevaluation |
| 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 |
b. Else, |
| 26 |
Let status be the result of performing PropertyDefinitionEvaluation for |
| 27 |
m with arguments F and 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 |
13.3.3.4 Static Semantics: IsSimpleParameterList |
| 44 |
|
| 45 |
BindingElement : BindingPattern |
| 46 |
|
| 47 |
1. Return false. |
| 48 |
|
| 49 |
14.1.2 Static Semantics: Early Errors |
| 50 |
|
| 51 |
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } |
| 52 |
FunctionDeclaration : function ( FormalParameters ) { FunctionBody } |
| 53 |
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody } |
| 54 |
|
| 55 |
- It is a Syntax Error if ContainsUseStrict of FunctionBody is true and |
| 56 |
IsSimpleParameterList of FormalParameters is false. |
| 57 |
|
| 58 |
14.2.1 Static Semantics: Early Errors |
| 59 |
|
| 60 |
ArrowFunction : ArrowParameters => ConciseBody |
| 61 |
|
| 62 |
- It is a Syntax Error if ContainsUseStrict of ConciseBody is true and |
| 63 |
IsSimpleParameterList of ArrowParameters is false. |
| 64 |
|
| 65 |
14.3.1 Static Semantics: Early Errors |
| 66 |
|
| 67 |
MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody } |
| 68 |
|
| 69 |
- It is a Syntax Error if ContainsUseStrict of FunctionBody is true and |
| 70 |
IsSimpleParameterList of UniqueFormalParameters is false. |
| 71 |
|
| 72 |
MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody } |
| 73 |
|
| 74 |
- It is a Syntax Error if ContainsUseStrict of FunctionBody is true and |
| 75 |
IsSimpleParameterList of PropertySetParameterList is false. |
| 76 |
|
| 77 |
14.4.1 Static Semantics: Early Errors |
| 78 |
|
| 79 |
GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody } |
| 80 |
|
| 81 |
- It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and |
| 82 |
IsSimpleParameterList of UniqueFormalParameters is false. |
| 83 |
|
| 84 |
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } |
| 85 |
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody } |
| 86 |
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } |
| 87 |
|
| 88 |
- It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and |
| 89 |
IsSimpleParameterList of UniqueFormalParameters is false. |
| 90 |
|
| 91 |
14.5.1 Static Semantics: Early Errors |
| 92 |
|
| 93 |
AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } |
| 94 |
|
| 95 |
- It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and |
| 96 |
IsSimpleParameterList of UniqueFormalParameters is false. |
| 97 |
|
| 98 |
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } |
| 99 |
AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody } |
| 100 |
AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } |
| 101 |
|
| 102 |
- It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and |
| 103 |
IsSimpleParameterList of FormalParameters is false. |
| 104 |
|
| 105 |
14.7.1 Static Semantics: Early Errors |
| 106 |
|
| 107 |
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } |
| 108 |
|
| 109 |
- It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and |
| 110 |
IsSimpleParameterList of UniqueFormalParameters is false. |
| 111 |
|
| 112 |
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } |
| 113 |
AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody } |
| 114 |
AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } |
| 115 |
AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } |
| 116 |
|
| 117 |
- It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and |
| 118 |
IsSimpleParameterList of FormalParameters is false. |
| 119 |
|
| 120 |
14.8.1 Static Semantics: Early Errors |
| 121 |
|
| 122 |
AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody |
| 123 |
|
| 124 |
- It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and |
| 125 |
IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false. |
| 126 |
|
| 127 |
---*/ |
| 128 |
$DONOTEVALUATE(); |
| 129 |
|
| 130 |
|
| 131 |
class C { |
| 132 |
static async method({property}) { |
| 133 |
"use strict"; |
| 134 |
} |
| 135 |
} |