invalid-left-hand-side.js (816B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2016 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-generator-function-definitions 6 es6id: 14.4 7 description: A YieldExpression is not a valid LeftHandSideExpression 8 info: | 9 AssignmentExpression[In, Yield] : 10 ConditionalExpression[?In, ?Yield] 11 [+Yield]YieldExpression[?In] 12 ArrowFunction[?In, ?Yield] 13 LeftHandSideExpression[?Yield] = AssignmentExpression[?In, ?Yield] 14 LeftHandSideExpression[?Yield] AssignmentOperator AssignmentExpression[?In, ?Yield] 15 16 LeftHandSideExpression[Yield] : 17 NewExpression[?Yield] 18 CallExpression[?Yield] 19 features: [generators] 20 negative: 21 phase: parse 22 type: SyntaxError 23 ---*/ 24 25 $DONOTEVALUATE(); 26 27 function* g() { 28 yield = 1; 29 }