Skip to content

Commit

Permalink
Allow [[ReferencedName]] in Reference Records to be a not-yet-resolve…
Browse files Browse the repository at this point in the history
…d property key.
  • Loading branch information
rkirsling committed Mar 29, 2024
1 parent 5d8f62d commit 008a166
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4162,7 +4162,7 @@ <h1>
<emu-clause id="sec-reference-record-specification-type" oldids="sec-reference-specification-type">
<h1>The Reference Record Specification Type</h1>
<p>The <dfn variants="Reference Records">Reference Record</dfn> type is used to explain the behaviour of such operators as `delete`, `typeof`, the assignment operators, the `super` keyword and other language features. For example, the left-hand operand of an assignment is expected to produce a Reference Record.</p>
<p>A Reference Record is a resolved name or property binding; its fields are defined by <emu-xref href="#table-reference-record-fields"></emu-xref>.</p>
<p>A Reference Record is a resolved name or (possibly not-yet-resolved) property binding; its fields are defined by <emu-xref href="#table-reference-record-fields"></emu-xref>.</p>

<emu-table id="table-reference-record-fields" caption="Reference Record Fields">
<table>
Expand All @@ -4178,8 +4178,8 @@ <h1>The Reference Record Specification Type</h1>
</tr>
<tr>
<td oldids="sec-getreferencedname,ao-getreferencedname">[[ReferencedName]]</td>
<td>a String, a Symbol, or a Private Name</td>
<td>The name of the binding. Always a String if [[Base]] value is an Environment Record.</td>
<td>a String, a Symbol, a Private Name, or an ECMAScript language value</td>
<td>The name of the binding. Always a String if [[Base]] value is an Environment Record. May temporarily be an ECMAScript language value other than a String or a Symbol in the case of a property reference for which ToPropertyKey has yet to be performed.</td>
</tr>
<tr>
<td oldids="sec-isstrictreference,ao-isstrictreference">[[Strict]]</td>
Expand Down Expand Up @@ -4264,6 +4264,9 @@ <h1>
1. [id="step-getvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]).
1. If IsPrivateReference(_V_) is *true*, then
1. Return ? PrivateGet(_baseObj_, _V_.[[ReferencedName]]).
1. If _V_.[[ReferencedName]] is neither a String nor a Symbol, then
1. Let _referencedName_ be ? ToPropertyKey(_V_.[[ReferencedName]]).
1. Set _V_.[[ReferencedName]] to _referencedName_.
1. Return ? <emu-meta effects="user-code">_baseObj_.[[Get]]</emu-meta>(_V_.[[ReferencedName]], GetThisValue(_V_)).
1. Else,
1. Let _base_ be _V_.[[Base]].
Expand Down Expand Up @@ -4295,6 +4298,9 @@ <h1>
1. [id="step-putvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]).
1. If IsPrivateReference(_V_) is *true*, then
1. Return ? PrivateSet(_baseObj_, _V_.[[ReferencedName]], _W_).
1. If _V_.[[ReferencedName]] is neither a String nor a Symbol, then
1. Let _referencedName_ be ? ToPropertyKey(_V_.[[ReferencedName]]).
1. Set _V_.[[ReferencedName]] to _referencedName_.
1. Let _succeeded_ be ? <emu-meta effects="user-code">_baseObj_.[[Set]]</emu-meta>(_V_.[[ReferencedName]], _W_, GetThisValue(_V_)).
1. If _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception.
1. Return ~unused~.
Expand Down Expand Up @@ -19147,8 +19153,7 @@ <h1>
<emu-alg>
1. Let _propertyNameReference_ be ? Evaluation of _expression_.
1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_).
1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_).
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyNameValue_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -19841,6 +19846,9 @@ <h1>Runtime Semantics: Evaluation</h1>
1. Assert: IsPrivateReference(_ref_) is *false*.
1. If IsSuperReference(_ref_) is *true*, throw a *ReferenceError* exception.
1. [id="step-delete-operator-toobject"] Let _baseObj_ be ? ToObject(_ref_.[[Base]]).
1. If _ref_.[[ReferencedName]] is neither a String nor a Symbol, then
1. Let _referencedName_ be ? ToPropertyKey(_ref_.[[ReferencedName]]).
1. Set _ref_.[[ReferencedName]] to _referencedName_.
1. Let _deleteStatus_ be ? <emu-meta effects="user-code">_baseObj_.[[Delete]]</emu-meta>(_ref_.[[ReferencedName]]).
1. If _deleteStatus_ is *false* and _ref_.[[Strict]] is *true*, throw a *TypeError* exception.
1. Return _deleteStatus_.
Expand Down

0 comments on commit 008a166

Please sign in to comment.