| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/function-forms/dflt-params-duplicates.case |
| 3 |
// - src/function-forms/syntax/cls-expr-gen-meth-static.template |
| 4 |
/*--- |
| 5 |
description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (static class expression generator method) |
| 6 |
esid: sec-class-definitions-runtime-semantics-evaluation |
| 7 |
features: [default-parameters, generators] |
| 8 |
flags: [generated] |
| 9 |
negative: |
| 10 |
phase: parse |
| 11 |
type: SyntaxError |
| 12 |
info: | |
| 13 |
ClassExpression : class BindingIdentifieropt ClassTail |
| 14 |
|
| 15 |
1. If BindingIdentifieropt is not present, let className be undefined. |
| 16 |
2. Else, let className be StringValue of BindingIdentifier. |
| 17 |
3. Let value be the result of ClassDefinitionEvaluation of ClassTail |
| 18 |
with 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 |
| 27 |
for m with arguments F and false. |
| 28 |
[...] |
| 29 |
|
| 30 |
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation |
| 31 |
|
| 32 |
GeneratorMethod : |
| 33 |
* PropertyName ( StrictFormalParameters ) { GeneratorBody } |
| 34 |
|
| 35 |
1. Let propKey be the result of evaluating PropertyName. |
| 36 |
2. ReturnIfAbrupt(propKey). |
| 37 |
3. If the function code for this GeneratorMethod is strict mode code, |
| 38 |
let strict be true. Otherwise let strict be false. |
| 39 |
4. Let scope be the running execution context's LexicalEnvironment. |
| 40 |
5. Let closure be GeneratorFunctionCreate(Method, |
| 41 |
StrictFormalParameters, GeneratorBody, scope, strict). |
| 42 |
|
| 43 |
9.2.1 [[Call]] ( thisArgument, argumentsList) |
| 44 |
|
| 45 |
[...] |
| 46 |
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). |
| 47 |
[...] |
| 48 |
|
| 49 |
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) |
| 50 |
|
| 51 |
1. Let status be FunctionDeclarationInstantiation(F, argumentsList). |
| 52 |
[...] |
| 53 |
|
| 54 |
9.2.12 FunctionDeclarationInstantiation(func, argumentsList) |
| 55 |
|
| 56 |
[...] |
| 57 |
23. Let iteratorRecord be Record {[[iterator]]: |
| 58 |
CreateListIterator(argumentsList), [[done]]: false}. |
| 59 |
24. If hasDuplicates is true, then |
| 60 |
[...] |
| 61 |
25. Else, |
| 62 |
b. Let formalStatus be IteratorBindingInitialization for formals with |
| 63 |
iteratorRecord and env as arguments. |
| 64 |
[...] |
| 65 |
|
| 66 |
|
| 67 |
14.1.2 Static Semantics: Early Errors |
| 68 |
|
| 69 |
StrictFormalParameters : FormalParameters |
| 70 |
|
| 71 |
- It is a Syntax Error if BoundNames of FormalParameters contains any |
| 72 |
duplicate elements. |
| 73 |
|
| 74 |
FormalParameters : FormalParameterList |
| 75 |
|
| 76 |
- It is a Syntax Error if IsSimpleParameterList of FormalParameterList is |
| 77 |
false and BoundNames of FormalParameterList contains any duplicate |
| 78 |
elements. |
| 79 |
|
| 80 |
---*/ |
| 81 |
throw "Test262: This statement should not be evaluated."; |
| 82 |
|
| 83 |
0, class { |
| 84 |
static *method(x = 0, x) { |
| 85 |
|
| 86 |
} |
| 87 |
}; |