yield-as-binding-identifier.js (844B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/generators/yield-as-binding-identifier.case 4 // - src/generators/syntax/expression.template 5 /*--- 6 description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Unnamed generator expression) 7 esid: prod-GeneratorExpression 8 features: [generators] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 14.4 Generator Function Definitions 15 16 GeneratorExpression: 17 function * BindingIdentifier opt ( FormalParameters ) { GeneratorBody } 18 19 20 BindingIdentifier : Identifier 21 22 It is a Syntax Error if this production has a [Yield] parameter and 23 StringValue of Identifier is "yield". 24 25 ---*/ 26 $DONOTEVALUATE(); 27 28 var gen = function *() { 29 var yield; 30 };