Skip to content

Commit fceabf7

Browse files
anbaljharb
authored andcommitted
Editorial: [[HomeObject]] is always an ordinary object
`[[HomeObject]]` is always set to an ordinary object (or `undefined`). Assert this in `MakeMethod` and `GetSuperBase`. `GetSuperBase` and `MakeSuperPropertyReference` are now both also infallible.
1 parent 54e795f commit fceabf7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

spec.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10796,16 +10796,16 @@ <h1>GetThisBinding ( ): either a normal completion containing an ECMAScript lang
1079610796
</emu-clause>
1079710797

1079810798
<emu-clause id="sec-getsuperbase" type="concrete method">
10799-
<h1>GetSuperBase ( ): either a normal completion containing either an Object, *null*, or *undefined*, or a throw completion</h1>
10799+
<h1>GetSuperBase ( ): an Object, *null*, or *undefined*</h1>
1080010800
<dl class="header">
1080110801
<dt>for</dt>
1080210802
<dd>a Function Environment Record _envRec_</dd>
1080310803
</dl>
1080410804
<emu-alg>
1080510805
1. Let _home_ be _envRec_.[[FunctionObject]].[[HomeObject]].
1080610806
1. If _home_ is *undefined*, return *undefined*.
10807-
1. Assert: _home_ is an Object.
10808-
1. Return ? <emu-meta effects="user-code">_home_.[[GetPrototypeOf]]</emu-meta>().
10807+
1. Assert: _home_ is an ordinary object.
10808+
1. Return ! _home_.[[GetPrototypeOf]]().
1080910809
</emu-alg>
1081010810
</emu-clause>
1081110811
</emu-clause>
@@ -13718,6 +13718,7 @@ <h1>
1371813718
<dd>It configures _F_ as a method.</dd>
1371913719
</dl>
1372013720
<emu-alg>
13721+
1. Assert: _homeObject_ is an ordinary object.
1372113722
1. Set _F_.[[HomeObject]] to _homeObject_.
1372213723
1. Return ~unused~.
1372313724
</emu-alg>
@@ -19446,15 +19447,15 @@ <h1>Runtime Semantics: Evaluation</h1>
1944619447
1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_).
1944719448
1. Let _strict_ be IsStrict(this |SuperProperty|).
1944819449
1. NOTE: In most cases, ToPropertyKey will be performed on _propertyNameValue_ immediately after this step. However, in the case of `super[b] = c`, it will not be performed until after evaluation of `c`.
19449-
1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyNameValue_, _strict_).
19450+
1. Return MakeSuperPropertyReference(_actualThis_, _propertyNameValue_, _strict_).
1945019451
</emu-alg>
1945119452
<emu-grammar>SuperProperty : `super` `.` IdentifierName</emu-grammar>
1945219453
<emu-alg>
1945319454
1. Let _env_ be GetThisEnvironment().
1945419455
1. Let _actualThis_ be ? _env_.GetThisBinding().
1945519456
1. Let _propertyKey_ be the StringValue of |IdentifierName|.
1945619457
1. Let _strict_ be IsStrict(this |SuperProperty|).
19457-
1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_).
19458+
1. Return MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_).
1945819459
</emu-alg>
1945919460
<emu-grammar>SuperCall : `super` Arguments</emu-grammar>
1946019461
<emu-alg>
@@ -19493,14 +19494,14 @@ <h1>
1949319494
_actualThis_: an ECMAScript language value,
1949419495
_propertyKey_: an ECMAScript language value,
1949519496
_strict_: a Boolean,
19496-
): either a normal completion containing a Super Reference Record or a throw completion
19497+
): a Super Reference Record
1949719498
</h1>
1949819499
<dl class="header">
1949919500
</dl>
1950019501
<emu-alg>
1950119502
1. Let _env_ be GetThisEnvironment().
1950219503
1. Assert: _env_.HasSuperBinding() is *true*.
19503-
1. Let _baseValue_ be ? _env_.GetSuperBase().
19504+
1. Let _baseValue_ be _env_.GetSuperBase().
1950419505
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: _actualThis_ }.
1950519506
</emu-alg>
1950619507
</emu-clause>

0 commit comments

Comments
 (0)