| 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-object-initializer-static-semantics-early-errors |
| 5 |
es6id: 12.2.6.1 |
| 6 |
description: Initialized name is explicitly barred from object initializers |
| 7 |
info: | |
| 8 |
PropertyDefinition : CoverInitializedName |
| 9 |
|
| 10 |
- Always throw a Syntax Error if code matches this production. |
| 11 |
|
| 12 |
NOTE This production exists so that ObjectLiteral can serve as a cover |
| 13 |
grammar for ObjectAssignmentPattern. It cannot occur in an actual object |
| 14 |
initializer. |
| 15 |
|
| 16 |
12.2.6 Object Initializer |
| 17 |
|
| 18 |
Syntax |
| 19 |
|
| 20 |
[...] |
| 21 |
|
| 22 |
CoverInitializedName[Yield]: |
| 23 |
|
| 24 |
IdentifierReference[?Yield] Initializer[+In, ?Yield] |
| 25 |
negative: |
| 26 |
phase: parse |
| 27 |
type: SyntaxError |
| 28 |
---*/ |
| 29 |
|
| 30 |
throw "Test262: This statement should not be evaluated."; |
| 31 |
|
| 32 |
({ a = 1 }); |