yield-as-label-identifier.js (1099B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/async-generators/yield-as-label-identifier.case 4 // - src/async-generators/syntax/async-class-decl-static-private-method.template 5 /*--- 6 description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassDeclaration element) 7 esid: prod-AsyncGeneratorMethod 8 features: [async-iteration, class-static-methods-private] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 ClassElement : 15 static PrivateMethodDefinition 16 17 MethodDefinition : 18 AsyncGeneratorMethod 19 20 Async Generator Function Definitions 21 22 AsyncGeneratorMethod : 23 async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } 24 25 26 LabelIdentifier : Identifier 27 28 It is a Syntax Error if this production has a [Yield] parameter and 29 StringValue of Identifier is "yield". 30 31 ---*/ 32 $DONOTEVALUATE(); 33 34 35 class C { static async *#gen() { 36 yield: ; 37 }}