Skip to content

Commit

Permalink
fixup: attach the global this value to the current realm, instead of …
Browse files Browse the repository at this point in the history
…using an intrinsic
  • Loading branch information
ljharb committed Oct 1, 2019
1 parent a17204e commit eb01bac
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -3079,17 +3079,6 @@ <h1>Well-Known Intrinsic Objects</h1>
The initial value of the `prototype` data property of %Generator%; i.e., %Generator.prototype%
</td>
</tr>
<tr>
<td>
%GlobalThisValue%
</td>
<td>
`globalThis`
</td>
<td>
The initial value of the `globalThis` property of the global object
</td>
</tr>
<tr>
<td>
%Int8Array%
Expand Down Expand Up @@ -7291,12 +7280,11 @@ <h1>CreateIntrinsics ( _realmRec_ )</h1>
<h1>SetRealmGlobalObject ( _realmRec_, _globalObj_, _thisValue_ )</h1>
<p>The abstract operation SetRealmGlobalObject with arguments _realmRec_, _globalObj_, and _thisValue_ performs the following steps:</p>
<emu-alg>
1. Let _intrinsics_ be _realmRec_.[[Intrinsics]].
1. If _globalObj_ is *undefined*, then
1. Let _intrinsics_ be _realmRec_.[[Intrinsics]].
1. Set _globalObj_ to ObjectCreate(_intrinsics_.[[%Object.prototype%]]).
1. Assert: Type(_globalObj_) is Object.
1. If _thisValue_ is *undefined*, set _thisValue_ to _globalObj_.
1. Set _intrinsics_.[[%GlobalThisValue%]] to _thisValue_.
1. Set _realmRec_.[[GlobalObject]] to _globalObj_.
1. Let _newGlobalEnv_ be NewGlobalEnvironment(_globalObj_, _thisValue_).
1. Set _realmRec_.[[GlobalEnv]] to _newGlobalEnv_.
Expand Down Expand Up @@ -7496,8 +7484,7 @@ <h1>GetNewTarget ( )</h1>
<h1>GetGlobalObject ( )</h1>
<p>The abstract operation GetGlobalObject returns the global object used by the currently running execution context. GetGlobalObject performs the following steps:</p>
<emu-alg>
1. Let _ctx_ be the running execution context.
1. Let _currentRealm_ be _ctx_'s Realm.
1. Let _currentRealm_ be the current Realm Record.
1. Return _currentRealm_.[[GlobalObject]].
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -24453,6 +24440,12 @@ <h1>The Global Object</h1>
<emu-clause id="sec-value-properties-of-the-global-object">
<h1>Value Properties of the Global Object</h1>

<emu-clause id="sec-global-this">
<h1>globalThis</h1>
<p>The initial value of `globalThis` in a Realm Record _realm_ is `_realm_.[[GlobalEnv]].[[GlobalThisValue]]`.
<p>This property has the attributes { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
</emu-clause>

<emu-clause id="sec-value-properties-of-the-global-object-infinity">
<h1>Infinity</h1>
<p>The value of `Infinity` is *+&infin;* (see <emu-xref href="#sec-ecmascript-language-types-number-type"></emu-xref>). This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.</p>
Expand Down Expand Up @@ -25270,12 +25263,6 @@ <h1>Math</h1>
<h1>Reflect</h1>
<p>See <emu-xref href="#sec-reflect-object"></emu-xref>.</p>
</emu-clause>

<emu-clause id="sec-global-this">
<h1>globalThis</h1>
<p>The initial value of `globalThis` is the well-known intrinsic object <dfn>%GlobalThisValue%</dfn>.</p>
<p>This property has the attributes { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
</emu-clause>
</emu-clause>
</emu-clause>

Expand Down

0 comments on commit eb01bac

Please sign in to comment.