async-gen-meth-dflt-params-duplicates.js (1583B)
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/async-gen-meth.template 5 /*--- 6 description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (async generator method) 7 esid: sec-asyncgenerator-definitions-propertydefinitionevaluation 8 features: [default-parameters, async-iteration] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 AsyncGeneratorMethod : 15 async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) 16 { AsyncGeneratorBody } 17 18 1. Let propKey be the result of evaluating PropertyName. 19 2. ReturnIfAbrupt(propKey). 20 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. 21 Otherwise let strict be false. 22 4. Let scope be the running execution context's LexicalEnvironment. 23 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, 24 AsyncGeneratorBody, scope, strict). 25 [...] 26 27 28 14.1.2 Static Semantics: Early Errors 29 30 StrictFormalParameters : FormalParameters 31 32 - It is a Syntax Error if BoundNames of FormalParameters contains any 33 duplicate elements. 34 35 FormalParameters : FormalParameterList 36 37 - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is 38 false and BoundNames of FormalParameterList contains any duplicate 39 elements. 40 41 ---*/ 42 $DONOTEVALUATE(); 43 44 0, { 45 async *method(x = 0, x) { 46 47 } 48 };