Debian Codegraph @

js/src/tests/test262/language/expressions/object/cover-initialized-name.js

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