| 1 |
// Copyright (C) 2016 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
esid: sec-assignment-operators-static-semantics-early-errors |
| 5 |
es6id: 12.14.1 |
| 6 |
description: Applied to a "covered" YieldExpression |
| 7 |
info: | |
| 8 |
AssignmentExpression : LeftHandSideExpression = AssignmentExpression |
| 9 |
|
| 10 |
- It is an early Reference Error if LeftHandSideExpression is neither an |
| 11 |
ObjectLiteral nor an ArrayLiteral and IsValidSimpleAssignmentTarget of |
| 12 |
LeftHandSideExpression is false. |
| 13 |
|
| 14 |
12.15.3 Static Semantics: IsValidSimpleAssignmentTarget |
| 15 |
|
| 16 |
AssignmentExpression: |
| 17 |
YieldExpression |
| 18 |
ArrowFunction |
| 19 |
LeftHandSideExpression = AssignmentExpression |
| 20 |
LeftHandSideExpression AssignmentOperator AssignmentExpression |
| 21 |
|
| 22 |
1. Return false. |
| 23 |
features: [generators] |
| 24 |
negative: |
| 25 |
phase: parse |
| 26 |
type: ReferenceError |
| 27 |
---*/ |
| 28 |
|
| 29 |
throw "Test262: This statement should not be evaluated."; |
| 30 |
|
| 31 |
function* g() { |
| 32 |
(yield) = 1; |
| 33 |
} |