Skip to content

Commit

Permalink
Normative: add global
Browse files Browse the repository at this point in the history
 - Adds intrinsic `%GlobalThisValue%`
 - Sets it in `SetRealmGlobalObject`
 - Adds global name `global`

Per tc39/proposal-global#12
  • Loading branch information
ljharb committed Sep 29, 2016
1 parent 2e6a254 commit 300fd51
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,17 @@ <h1>Well-Known Intrinsic Objects</h1>
The constructor of async function objects (<emu-xref href="#sec-async-function-constructor"></emu-xref>)
</td>
</tr>
<tr>
<td>
%GlobalThisValue%
</td>
<td>
`global`
</td>
<td>
The initial value of the `global` property of the global object
</td>
</tr>
<tr>
<td>
%Int8Array%
Expand Down Expand Up @@ -5889,11 +5900,12 @@ <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. Let _globalObj_ be ObjectCreate(_intrinsics_.[[%ObjectPrototype%]]).
1. Assert: Type(_globalObj_) is Object.
1. If _thisValue_ is *undefined*, let _thisValue_ be _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 @@ -23237,6 +23249,12 @@ <h1>Math</h1>
<h1>Reflect</h1>
<p>See <emu-xref href="#sec-reflect-object"></emu-xref>.</p>
</emu-clause>

<emu-clause id="sec-global">
<h1>global</h1>
<p>The initial value of `global` 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 300fd51

Please sign in to comment.