Skip to content

Commit

Permalink
Allow null or undefined in Reference Records
Browse files Browse the repository at this point in the history
  • Loading branch information
codehag committed Jan 5, 2021
1 parent 130d966 commit 7f38832
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -3740,7 +3740,7 @@ <h1>The Reference Record Specification Type</h1>
One of:
<ul>
<li>
any ECMAScript language value except *undefined* or *null*,
any ECMAScript language value,
</li>
<li>
an Environment Record, or
Expand Down Expand Up @@ -3779,7 +3779,7 @@ <h1>IsPropertyReference ( _V_ )</h1>
<emu-alg>
1. Assert: _V_ is a Reference Record.
1. If _V_.[[Base]] is ~unresolvable~, return *false*.
1. If Type(_V_.[[Base]]) is Boolean, String, Symbol, BigInt, Number, or Object, return *true*; otherwise return *false*.
1. If _V_.[[Base]] is an Environment Record, return *false*; otherwise return *true*.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -3809,7 +3809,7 @@ <h1>GetValue ( _V_ )</h1>
1. If _V_ is not a Reference Record, return _V_.
1. If IsUnresolvableReference(_V_) is *true*, throw a *ReferenceError* exception.
1. If IsPropertyReference(_V_) is *true*, then
1. [id="step-getvalue-toobject"] Let _baseObj_ be ! ToObject(_V_.[[Base]]).
1. [id="step-getvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]).
1. Return ? _baseObj_.[[Get]](_V_.[[ReferencedName]], GetThisValue(_V_)).
1. Else,
1. Let _base_ be _V_.[[Base]].
Expand All @@ -3833,7 +3833,7 @@ <h1>PutValue ( _V_, _W_ )</h1>
1. Let _globalObj_ be GetGlobalObject().
1. Return ? Set(_globalObj_, _V_.[[ReferencedName]], _W_, *false*).
1. If IsPropertyReference(_V_) is *true*, then
1. [id="step-putvalue-toobject"] Let _baseObj_ be ! ToObject(_V_.[[Base]]).
1. [id="step-putvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]).
1. Let _succeeded_ be ? _baseObj_.[[Set]](_V_.[[ReferencedName]], _W_, GetThisValue(_V_)).
1. If _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception.
1. Return.
Expand Down Expand Up @@ -13567,19 +13567,17 @@ <h1>EvaluatePropertyAccessWithExpressionKey ( _baseValue_, _expression_, _strict
<emu-alg>
1. Let _propertyNameReference_ be the result of evaluating _expression_.
1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_).
1. Let _bv_ be ? RequireObjectCoercible(_baseValue_).
1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_).
1. Return the Reference Record { [[Base]]: _bv_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
</emu-alg>
</emu-clause>
<emu-clause id="sec-evaluate-property-access-with-identifier-key" aoid="EvaluatePropertyAccessWithIdentifierKey" oldids="sec-evaluate-identifier-key-property-access">
<h1>EvaluatePropertyAccessWithIdentifierKey ( _baseValue_, _identifierName_, _strict_ )</h1>
<p>The abstract operation EvaluatePropertyAccessWithIdentifierKey takes arguments _baseValue_ (an ECMAScript language value), _identifierName_ (a Parse Node), and _strict_ (a Boolean). It performs the following steps when called:</p>
<emu-alg>
1. Assert: _identifierName_ is an |IdentifierName|.
1. Let _bv_ be ? RequireObjectCoercible(_baseValue_).
1. Let _propertyNameString_ be StringValue of _identifierName_.
1. Return the Reference Record { [[Base]]: _bv_, [[ReferencedName]]: _propertyNameString_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyNameString_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -13731,8 +13729,7 @@ <h1>MakeSuperPropertyReference ( _actualThis_, _propertyKey_, _strict_ )</h1>
1. Let _env_ be GetThisEnvironment().
1. Assert: _env_.HasSuperBinding() is *true*.
1. Let _baseValue_ be ? _env_.GetSuperBase().
1. Let _bv_ be ? RequireObjectCoercible(_baseValue_).
1. Return the Reference Record { [[Base]]: _bv_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: _actualThis_ }.
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: _actualThis_ }.
1. NOTE: This returns a Super Reference Record.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -14205,7 +14202,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1. Return *true*.
1. If IsPropertyReference(_ref_) is *true*, then
1. If IsSuperReference(_ref_) is *true*, throw a *ReferenceError* exception.
1. [id="step-delete-operator-toobject"] Let _baseObj_ be ! ToObject(_ref_.[[Base]]).
1. [id="step-delete-operator-toobject"] Let _baseObj_ be ? ToObject(_ref_.[[Base]]).
1. Let _deleteStatus_ be ? _baseObj_.[[Delete]](_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 7f38832

Please sign in to comment.