yield-as-label-identifier.js (981B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/generators/yield-as-label-identifier.case 4 // - src/generators/syntax/class-expr-private-method.template 5 /*--- 6 description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Generator private method as a ClassExpression element) 7 esid: prod-GeneratorMethod 8 features: [generators, class-methods-private] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 ClassElement : 15 PrivateMethodDefinition 16 17 MethodDefinition : 18 GeneratorMethod 19 20 14.4 Generator Function Definitions 21 22 GeneratorMethod : 23 * # PropertyName ( UniqueFormalParameters ) { GeneratorBody } 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 var C = class {*#gen() { 35 yield: ; 36 }};