dflt-params-duplicates.js (2302B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/function-forms/dflt-params-duplicates.case 4 // - src/function-forms/syntax/cls-expr-async-gen-meth-static.template 5 /*--- 6 description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (static class expression async generator method) 7 esid: sec-class-definitions-runtime-semantics-evaluation 8 features: [default-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 14.1.2 Static Semantics: Early Errors 48 49 StrictFormalParameters : FormalParameters 50 51 - It is a Syntax Error if BoundNames of FormalParameters contains any 52 duplicate elements. 53 54 FormalParameters : FormalParameterList 55 56 - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is 57 false and BoundNames of FormalParameterList contains any duplicate 58 elements. 59 60 ---*/ 61 $DONOTEVALUATE(); 62 63 0, class { 64 static async *method(x = 0, x) { 65 66 } 67 };