| 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 new.target |
| 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.3.1.5 Static Semantics: IsValidSimpleAssignmentTarget |
| 15 |
|
| 16 |
NewTarget: |
| 17 |
|
| 18 |
new.target |
| 19 |
|
| 20 |
1. Return false. |
| 21 |
negative: |
| 22 |
phase: parse |
| 23 |
type: ReferenceError |
| 24 |
---*/ |
| 25 |
|
| 26 |
throw "Test262: This statement should not be evaluated."; |
| 27 |
|
| 28 |
function f() { |
| 29 |
new.target = 1; |
| 30 |
} |