Skip to content

Commit

Permalink
Move the early error rule for ObjectLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdyck committed Nov 24, 2023
1 parent b598519 commit d2f6cd1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -18416,6 +18416,19 @@ <h2>Syntax</h2>

<emu-clause id="sec-object-initializer-static-semantics-early-errors" oldids="sec-__proto__-property-names-in-object-initializers">
<h1>Static Semantics: Early Errors</h1>
<emu-grammar>
ObjectLiteral :
`{` PropertyDefinitionList `}`
`{` PropertyDefinitionList `,` `}`
</emu-grammar>
<ul>
<li>
It is a Syntax Error if 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>).
</li>
</ul>
<emu-note>
<p>The List returned by PropertyNameList does not include property names defined using a |ComputedPropertyName|.</p>
</emu-note>
<emu-grammar>PropertyDefinition : MethodDefinition</emu-grammar>
<ul>
<li>
Expand All @@ -18434,19 +18447,6 @@ <h1>Static Semantics: Early Errors</h1>
<emu-note>
<p>This production exists so that |ObjectLiteral| can serve as a cover grammar for |ObjectAssignmentPattern|. It cannot occur in an actual object initializer.</p>
</emu-note>
<emu-grammar>
ObjectLiteral :
`{` PropertyDefinitionList `}`
`{` PropertyDefinitionList `,` `}`
</emu-grammar>
<ul>
<li>
It is a Syntax Error if 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>).
</li>
</ul>
<emu-note>
<p>The List returned by PropertyNameList does not include property names defined using a |ComputedPropertyName|.</p>
</emu-note>
</emu-clause>

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

0 comments on commit d2f6cd1

Please sign in to comment.