Skip to content

Commit

Permalink
Normative: add #x in obj syntax (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 25, 2021
1 parent 80efe41 commit 791f910
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -7690,6 +7690,7 @@ <h1>Static Semantics: IsFunctionDefinition</h1>
RelationalExpression `&gt;=` ShiftExpression
RelationalExpression `instanceof` ShiftExpression
RelationalExpression `in` ShiftExpression
PrivateIdentifier `in` ShiftExpression

EqualityExpression :
EqualityExpression `==` RelationalExpression
Expand Down Expand Up @@ -8438,6 +8439,7 @@ <h1>Static Semantics: AssignmentTargetType</h1>
RelationalExpression `&gt;=` ShiftExpression
RelationalExpression `instanceof` ShiftExpression
RelationalExpression `in` ShiftExpression
PrivateIdentifier `in` ShiftExpression

EqualityExpression :
EqualityExpression `==` RelationalExpression
Expand Down Expand Up @@ -17119,6 +17121,7 @@ <h2>Syntax</h2>
RelationalExpression[?In, ?Yield, ?Await] `&gt;=` ShiftExpression[?Yield, ?Await]
RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await]
[+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await]
[+In] PrivateIdentifier `in` ShiftExpression[?Yield, ?Await]
</emu-grammar>
<emu-note>
<p>The <sub>[In]</sub> grammar parameter is needed to avoid confusing the `in` operator in a relational expression with the `in` operator in a `for` statement.</p>
Expand Down Expand Up @@ -17179,6 +17182,17 @@ <h1>Runtime Semantics: Evaluation</h1>
1. If Type(_rval_) is not Object, throw a *TypeError* exception.
1. Return ? HasProperty(_rval_, ? ToPropertyKey(_lval_)).
</emu-alg>
<emu-grammar>RelationalExpression : PrivateIdentifier `in` ShiftExpression</emu-grammar>
<emu-alg>
1. Let _privateIdentifier_ be the StringValue of |PrivateIdentifier|.
1. Let _rref_ be the result of evaluating |ShiftExpression|.
1. Let _rval_ be ? GetValue(_rref_).
1. If Type(_rval_) is not Object, throw a *TypeError* exception.
1. Let _privateEnv_ be the running execution context's PrivateEnvironment.
1. Let _privateName_ be ! ResolvePrivateIdentifier(_privateEnv_, _privateIdentifier_).
1. If ! PrivateElementFind(_privateName_, _rval_) is not ~empty~, return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-instanceofoperator" aoid="InstanceofOperator">
Expand Down Expand Up @@ -21223,6 +21237,13 @@ <h1>Static Semantics: AllPrivateIdentifiersValid</h1>
1. Append to _newNames_ the elements of PrivateBoundIdentifiers of |ClassBody|.
1. Return AllPrivateIdentifiersValid of |ClassElementList| with argument _newNames_.
</emu-alg>

<emu-grammar>RelationalExpression : PrivateIdentifier `in` ShiftExpression</emu-grammar>
<emu-alg>
1. If _names_ contains the StringValue of |PrivateIdentifier|, then
1. Return AllPrivateIdentifiersValid of |ShiftExpression| with argument _names_.
1. Return *false*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-static-semantics-privateboundidentifiers" type="sdo" aoid="PrivateBoundIdentifiers">
Expand Down Expand Up @@ -22085,6 +22106,7 @@ <h1>Expression Rules</h1>
RelationalExpression `&gt;=` ShiftExpression
RelationalExpression `instanceof` ShiftExpression
RelationalExpression `in` ShiftExpression
PrivateIdentifier `in` ShiftExpression

ShiftExpression :
ShiftExpression `&lt;&lt;` AdditiveExpression
Expand Down

0 comments on commit 791f910

Please sign in to comment.