Skip to content

Commit 5398da0

Browse files
committed
Move the early error rule for ObjectLiteral
1 parent 3d368dd commit 5398da0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

spec.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -18406,6 +18406,19 @@ <h2>Syntax</h2>
1840618406

1840718407
<emu-clause id="sec-object-initializer-static-semantics-early-errors" oldids="sec-__proto__-property-names-in-object-initializers">
1840818408
<h1>Static Semantics: Early Errors</h1>
18409+
<emu-grammar>
18410+
ObjectLiteral :
18411+
`{` PropertyDefinitionList `}`
18412+
`{` PropertyDefinitionList `,` `}`
18413+
</emu-grammar>
18414+
<ul>
18415+
<li>
18416+
It is a Syntax Error if the PropertyNameList of |PropertyDefinitionList| contains any duplicate entries for *"__proto__"* and at least two of those entries were obtained from productions of the form <emu-grammar>PropertyDefinition : PropertyName `:` AssignmentExpression</emu-grammar>. This rule is not applied if this |ObjectLiteral| is contained within a |Script| that is being parsed for JSON.parse (see step <emu-xref href="#step-json-parse-parse"></emu-xref> of <emu-xref href="#sec-json.parse">JSON.parse</emu-xref>).
18417+
</li>
18418+
</ul>
18419+
<emu-note>
18420+
<p>The List returned by PropertyNameList does not include property names defined using a |ComputedPropertyName|.</p>
18421+
</emu-note>
1840918422
<emu-grammar>PropertyDefinition : MethodDefinition</emu-grammar>
1841018423
<ul>
1841118424
<li>
@@ -18424,19 +18437,6 @@ <h1>Static Semantics: Early Errors</h1>
1842418437
<emu-note>
1842518438
<p>This production exists so that |ObjectLiteral| can serve as a cover grammar for |ObjectAssignmentPattern|. It cannot occur in an actual object initializer.</p>
1842618439
</emu-note>
18427-
<emu-grammar>
18428-
ObjectLiteral :
18429-
`{` PropertyDefinitionList `}`
18430-
`{` PropertyDefinitionList `,` `}`
18431-
</emu-grammar>
18432-
<ul>
18433-
<li>
18434-
It is a Syntax Error if the PropertyNameList of |PropertyDefinitionList| contains any duplicate entries for *"__proto__"* and at least two of those entries were obtained from productions of the form <emu-grammar>PropertyDefinition : PropertyName `:` AssignmentExpression</emu-grammar>. This rule is not applied if this |ObjectLiteral| is contained within a |Script| that is being parsed for JSON.parse (see step <emu-xref href="#step-json-parse-parse"></emu-xref> of <emu-xref href="#sec-json.parse">JSON.parse</emu-xref>).
18435-
</li>
18436-
</ul>
18437-
<emu-note>
18438-
<p>The List returned by PropertyNameList does not include property names defined using a |ComputedPropertyName|.</p>
18439-
</emu-note>
1844018440
</emu-clause>
1844118441

1844218442
<emu-clause id="sec-static-semantics-iscomputedpropertykey" type="sdo">

0 commit comments

Comments
 (0)