This repository has been archived by the owner on Oct 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathspec.emu
67 lines (65 loc) · 2.58 KB
/
spec.emu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!doctype html>
<meta charset="utf8">
<link rel="stylesheet" href="./spec.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="./spec.js"></script>
<pre class="metadata">
title: global
stage: 4
contributors: Jordan Harband
</pre>
<emu-clause id="sec-other-properties-of-the-global-object">
<h1>Other Properties of the Global Object</h1>
<emu-clause id="sec-other-properties-of-the-global-object-global">
<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 id="sec-well-known-intrinsic-objects">
<h1>Well-Known Intrinsic Objects</h1>
<emu-table id="table-7" caption="Well-known Intrinsic Objects">
<table>
<tbody>
<tr>
<th>Intrinsic Name</th>
<th>Global Name</th>
<th>ECMAScript Language Association</th>
</tr>
<tr>
<td>%GeneratorPrototype%</td>
<td></td>
<td>The initial value of the <code>prototype</code> property of %Generator%</td>
</tr>
<tr>
<td><ins>%GlobalThisValue%</ins></td>
<td><ins><code>globalThis</code></ins></td>
<td><ins>The initial value of the <code>globalThis</code> property of the global object</ins></td>
</tr>
<tr>
<td>%Int8Array%</td>
<td><code>Int8Array</code></td>
<td>The <code>Int8Array</code> constructor (<emu-xref href="#sec-typedarray-objects"></emu-xref>)</td>
</tr>
</tbody>
</table>
</emu-table>
</emu-clause>
<!-- es6num="8.2.3" -->
<emu-clause id="sec-setrealmglobalobject" aoid="SetRealmGlobalObject">
<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. <ins>Let _intrinsics_ be _realmRec_.[[Intrinsics]].</ins>
1. If _globalObj_ is *undefined*, then
1. <del>Let _intrinsics_ be _realmRec_.[[Intrinsics]].</del>
1. Let _globalObj_ be ObjectCreate(_intrinsics_.[[%ObjectPrototype%]]).
1. Assert: Type(_globalObj_) is Object.
1. If _thisValue_ is *undefined*, let _thisValue_ be _globalObj_.
1. <ins>Set _intrinsics_.[[%GlobalThisValue%]] to _thisValue_.</ins>
1. Set _realmRec_.[[GlobalObject]] to _globalObj_.
1. Let _newGlobalEnv_ be NewGlobalEnvironment(_globalObj_, _thisValue_).
1. Set _realmRec_.[[GlobalEnv]] to _newGlobalEnv_.
1. Return _realmRec_.
</emu-alg>
</emu-clause>