forked from tc39/proposal-shadowrealm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
269 lines (206 loc) · 44.5 KB
/
index.html
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!doctype html>
<head><meta charset="utf-8">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="https://bterlson.github.io/ecmarkup/ecmarkup.js"></script>
<link rel="stylesheet" href="https://bterlson.github.io/ecmarkup/elements.css">
<title>ECMAScript Realms Spec Proposal</title><script type="application/json" id="menu-search-biblio">[{"type":"op","aoid":"PerformEval","refId":"sec-performeval","location":"","key":"PerformEval"},{"type":"clause","id":"sec-performeval","aoid":"PerformEval","title":"Runtime Semantics: PerformEval( _x_, _evalRealm_, _strictCaller_, _direct_ )","number":"1","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Runtime Semantics: PerformEval( _x_, _evalRealm_, _strictCaller_, _direct_ )"},{"type":"clause","id":"sec-realm-objects","aoid":null,"title":"Realm Objects","number":"2","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm Objects"},{"type":"clause","id":"sec-realm-abstract-operations","aoid":null,"title":"Realm Abstract Operations","number":"2.1","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm Abstract Operations"},{"type":"op","aoid":"PrepareForDirectEval","refId":"sec-preparefordirecteval","location":"","key":"PrepareForDirectEval"},{"type":"clause","id":"sec-preparefordirecteval","aoid":"PrepareForDirectEval","title":"PrepareForDirectEval ( _x_, _realmRec_ )","number":"2.1.1","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"PrepareForDirectEval ( _x_, _realmRec_ )"},{"type":"op","aoid":"PrepareForIndirectEval","refId":"sec-prepareforindirecteval","location":"","key":"PrepareForIndirectEval"},{"type":"clause","id":"sec-prepareforindirecteval","aoid":"PrepareForIndirectEval","title":"PrepareForIndirectEval ( _x_, _realmRec_ )","number":"2.1.2","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"PrepareForIndirectEval ( _x_, _realmRec_ )"},{"type":"op","aoid":"ExtractRealmMethods","refId":"sec-extract-realm-methods","location":"","key":"ExtractRealmMethods"},{"type":"clause","id":"sec-extract-realm-methods","aoid":"ExtractRealmMethods","title":"ExtractRealmMethods ( _realmObj_ )","number":"2.1.3","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"ExtractRealmMethods ( _realmObj_ )"},{"type":"clause","id":"sec-the-realm-constructor","aoid":null,"title":"The Realm Constructor","number":"2.2","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"The Realm Constructor"},{"type":"op","aoid":"Realm","refId":"sec-realm","location":"","key":"Realm"},{"type":"clause","id":"sec-realm","aoid":"Realm","title":"Realm ([ _target_, _handler_ ])","number":"2.2.1","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm ([ _target_, _handler_ ])"},{"type":"clause","id":"sec-properties-of-the-realm-constructor","aoid":null,"title":"Properties of the Realm Constructor","number":"2.3","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Properties of the Realm Constructor"},{"type":"clause","id":"sec-properties-of-the-realm-prototype-object","aoid":null,"title":"Properties of the Realm Prototype Object","number":"2.4","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Properties of the Realm Prototype Object"},{"type":"clause","id":"sec-realm.prototype.init","aoid":null,"title":"Realm.prototype.init ()","number":"2.4.1","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm.prototype.init ()"},{"type":"clause","id":"sec-realm.prototype.eval","aoid":null,"title":"Realm.prototype.eval ( _x_ )","number":"2.4.2","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm.prototype.eval ( _x_ )"},{"type":"clause","id":"sec-realm.prototype-@@directEval","aoid":null,"title":"Realm.prototype [ @@directEval ] ( _x_ )","number":"2.4.3","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm.prototype [ @@directEval ] ( _x_ )"},{"type":"clause","id":"sec-realm.prototype-@@indirectEval","aoid":null,"title":"Realm.prototype [ @@indirectEval ] ( _x_ )","number":"2.4.4","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm.prototype [ @@indirectEval ] ( _x_ )"},{"type":"clause","id":"sec-realm.prototype.global","aoid":null,"title":"get Realm.prototype.global","number":"2.4.5","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"get Realm.prototype.global"},{"type":"clause","id":"sec-realm.prototype.stdlib","aoid":null,"title":"get Realm.prototype.stdlib","number":"2.4.6","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"get Realm.prototype.stdlib"},{"type":"clause","id":"sec-realm.prototype.intrinsics","aoid":null,"title":"get Realm.prototype.intrinsics","number":"2.4.7","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"get Realm.prototype.intrinsics"},{"type":"clause","id":"sec-realm.prototype-@@tostringtag","aoid":null,"title":"Realm.prototype [ @@toStringTag ]","number":"2.4.8","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Realm.prototype [ @@toStringTag ]"},{"type":"clause","id":"sec-properties-of-realm-instances","aoid":null,"title":"Properties of Realm Instances","number":"2.5","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Properties of Realm Instances"},{"type":"table","id":"table-1","number":1,"caption":"Table 1: Well-known Intrinsic Objects","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Table 1: Well-known Intrinsic Objects"},{"type":"table","id":"table-2","number":2,"caption":"Table 2: Well-known Symbols","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Table 2: Well-known Symbols"},{"type":"table","id":"table-2","number":3,"caption":"Table 3: Realm Record Fields","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Table 3: Realm Record Fields"},{"type":"table","id":"table-3","number":4,"caption":"Table 4: Internal Slots of Realm Instances","namespace":"https://rawgit.com/caridy/proposal-realms/master/index.html","location":"","key":"Table 4: Internal Slots of Realm Instances"}]</script></head><body><div id="menu-toggle">☰</div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-performeval" title="Runtime Semantics: PerformEval( _x_, _evalRealm_, _strictCaller_, _direct_ )"><span class="secnum">1</span> RS: PerformEval( <var>x</var>, <var>evalRealm</var>, <var>strictCaller</var>, <var>direct</var> )</a></li><li><span class="item-toggle">◢</span><a href="#sec-realm-objects" title="Realm Objects"><span class="secnum">2</span> Realm Objects</a><ol class="toc"><li><span class="item-toggle">◢</span><a href="#sec-realm-abstract-operations" title="Realm Abstract Operations"><span class="secnum">2.1</span> Realm Abstract Operations</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-preparefordirecteval" title="PrepareForDirectEval ( _x_, _realmRec_ )"><span class="secnum">2.1.1</span> PrepareForDirectEval ( <var>x</var>, <var>realmRec</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-prepareforindirecteval" title="PrepareForIndirectEval ( _x_, _realmRec_ )"><span class="secnum">2.1.2</span> PrepareForIndirectEval ( <var>x</var>, <var>realmRec</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-extract-realm-methods" title="ExtractRealmMethods ( _realmObj_ )"><span class="secnum">2.1.3</span> ExtractRealmMethods ( <var>realmObj</var> )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-the-realm-constructor" title="The Realm Constructor"><span class="secnum">2.2</span> The Realm Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-realm" title="Realm ([ _target_, _handler_ ])"><span class="secnum">2.2.1</span> Realm ([ <var>target</var>, <var>handler</var> ])</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-the-realm-constructor" title="Properties of the Realm Constructor"><span class="secnum">2.3</span> Properties of the Realm Constructor</a></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-the-realm-prototype-object" title="Properties of the Realm Prototype Object"><span class="secnum">2.4</span> Properties of the Realm Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype.init" title="Realm.prototype.init ()"><span class="secnum">2.4.1</span> Realm.prototype.init ()</a></li><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype.eval" title="Realm.prototype.eval ( _x_ )"><span class="secnum">2.4.2</span> Realm.prototype.eval ( <var>x</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype-@@directEval" title="Realm.prototype [ @@directEval ] ( _x_ )"><span class="secnum">2.4.3</span> Realm.prototype [ @@directEval ] ( <var>x</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype-@@indirectEval" title="Realm.prototype [ @@indirectEval ] ( _x_ )"><span class="secnum">2.4.4</span> Realm.prototype [ @@indirectEval ] ( <var>x</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype.global" title="get Realm.prototype.global"><span class="secnum">2.4.5</span> get Realm.prototype.global</a></li><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype.stdlib" title="get Realm.prototype.stdlib"><span class="secnum">2.4.6</span> get Realm.prototype.stdlib</a></li><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype.intrinsics" title="get Realm.prototype.intrinsics"><span class="secnum">2.4.7</span> get Realm.prototype.intrinsics</a></li><li><span class="item-toggle-none"></span><a href="#sec-realm.prototype-@@tostringtag" title="Realm.prototype [ @@toStringTag ]"><span class="secnum">2.4.8</span> Realm.prototype [ @@toStringTag ]</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-realm-instances" title="Properties of Realm Instances"><span class="secnum">2.5</span> Properties of Realm Instances</a></li></ol></li></ol></div></div><h1 class="version">May 10, 2016</h1><h1 class="title">ECMAScript Realms Spec Proposal</h1>
<emu-table id="table-1" caption="Well-known Intrinsic Objects"><figure><figcaption>Table 1: Well-known Intrinsic Objects</figcaption>
<table>
<tbody>
<tr>
<th>Intrinsic Name</th>
<th>Global Name</th>
<th>ECMAScript Language Association</th>
</tr>
<tr>
<td>%Realm%</td>
<td><code>Realm</code></td>
<td>…</td>
</tr>
<tr>
<td>%RealmPrototype%</td>
<td><code>Realm.prototype</code></td>
<td>…</td>
</tr>
</tbody>
</table>
</figure></emu-table>
<emu-table id="table-2" caption="Well-known Symbols"><figure><figcaption>Table 2: Well-known Symbols</figcaption>
<table>
<tbody>
<tr>
<th>Specification Name</th>
<th>[[Description]]</th>
<th>Value and Purpose</th>
</tr>
<tr>
<td>@@indirectEval</td>
<td><code>Realm.indirectEval</code></td>
<td>A function valued property that is the indirectEval hook function of Realm’s instances.</td>
</tr>
<tr>
<td>@@directEval</td>
<td><code>Realm.directEval</code></td>
<td>A function valued property that is the directEval hook function of Realm’s instances.</td>
</tr>
</tbody>
</table>
</figure></emu-table>
<emu-table id="table-2" caption="Realm Record Fields"><figure><figcaption>Table 3: <emu-xref href="#realm-record"><a href="https://tc39.github.io/ecma262/#realm-record">Realm Record</a></emu-xref> Fields</figcaption>
<table>
<tbody>
<tr>
<th>Field Name</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[HostDefined]]</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>[[IndirectEval]]</td>
<td>Object | Undefined</td>
<td>If the value is an Object it must be a function object. The function is call prior to perform any indirect evaluation in the realm.</td>
</tr>
<tr>
<td>[[DirectEval]]</td>
<td>Object | Undefined</td>
<td>If the value is an Object it must be a function object. The function is call prior to perform any direct evaluation in the realm.</td>
</tr>
</tbody>
</table>
</figure></emu-table>
<!-- es6num="18.2.1.1" -->
<emu-clause id="sec-performeval" aoid="PerformEval">
<h1><span class="secnum">1</span>Runtime Semantics: PerformEval( <var>x</var>, <var>evalRealm</var>, <var>strictCaller</var>, <var>direct</var> )<span class="utils"><span class="anchor"><a href="#sec-performeval">#</a></span></span></h1>
<p>The abstract operation PerformEval with arguments <var>x</var>, <var>evalRealm</var>, <var>strictCaller</var>, and <var>direct</var> performs the following steps:</p>
<emu-alg><ol><li>Assert: If <var>direct</var> is <emu-val>false</emu-val>, then <var>strictCaller</var> is also <emu-val>false</emu-val>.</li><li><ins>If <var>direct</var> is <emu-val>true</emu-val>, then</ins><ol><li><ins>Let <var>xValue</var> be ? <emu-xref aoid="PrepareForDirectEval"><a href="#sec-preparefordirecteval">PrepareForDirectEval</a></emu-xref>(<var>x</var>, <var>evalRealm</var>).</ins></li></ol></li><li><ins>Else,</ins><ol><li><ins>Let <var>xValue</var> be ? <emu-xref aoid="PrepareForIndirectEval"><a href="#sec-prepareforindirecteval">PrepareForIndirectEval</a></emu-xref>(<var>x</var>, <var>evalRealm</var>).</ins></li></ol></li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>xValue</var>) is not String, return <var>xValue</var>.</li><li>Let <var>script</var> be the ECMAScript code that is the result of parsing <var>xValue</var>, interpreted as UTF-16 encoded Unicode text as described in <emu-xref href="#sec-ecmascript-language-types-string-type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type">6.1.4</a></emu-xref>, for the goal symbol <emu-nt><a href="https://tc39.github.io/ecma262/#prod-Script">Script</a></emu-nt>. If the parse fails, throw a <emu-val>SyntaxError</emu-val> exception. If any early errors are detected, throw a <emu-val>SyntaxError</emu-val> or a <emu-val>ReferenceError</emu-val> exception, depending on the type of the error (but see also clause <emu-xref href="#sec-error-handling-and-language-extensions"><a href="https://tc39.github.io/ecma262/#sec-error-handling-and-language-extensions">16</a></emu-xref>). Parsing and <emu-xref href="#early-error"><a href="https://tc39.github.io/ecma262/#early-error">early error</a></emu-xref> detection may be interweaved in an implementation dependent manner.</li><li>If <var>script</var> Contains <emu-nt><a href="https://tc39.github.io/ecma262/#prod-ScriptBody">ScriptBody</a></emu-nt> is <emu-val>false</emu-val>, return <emu-val>undefined</emu-val>.</li><li>Let <var>body</var> be the <emu-nt><a href="https://tc39.github.io/ecma262/#prod-ScriptBody">ScriptBody</a></emu-nt> of <var>script</var>.</li><li>If <var>strictCaller</var> is <emu-val>true</emu-val>, let <var>strictEval</var> be <emu-val>true</emu-val>.</li><li>Else, let <var>strictEval</var> be IsStrict of <var>script</var>.</li><li>Let <var>ctx</var> be the <emu-xref href="#running-execution-context"><a href="https://tc39.github.io/ecma262/#running-execution-context">running execution context</a></emu-xref>. If <var>direct</var> is <emu-val>true</emu-val>, <var>ctx</var> will be the <emu-xref href="#sec-execution-contexts"><a href="https://tc39.github.io/ecma262/#sec-execution-contexts">execution context</a></emu-xref> that performed the direct eval. If <var>direct</var> is <emu-val>false</emu-val>, <var>ctx</var> will be the <emu-xref href="#sec-execution-contexts"><a href="https://tc39.github.io/ecma262/#sec-execution-contexts">execution context</a></emu-xref> for the invocation of the <code>eval</code> function.</li><li>If <var>direct</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>lexEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment"><a href="https://tc39.github.io/ecma262/#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>ctx</var>'s LexicalEnvironment).</li><li>Let <var>varEnv</var> be <var>ctx</var>'s VariableEnvironment.</li></ol></li><li>Else,<ol><li>Let <var>lexEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment"><a href="https://tc39.github.io/ecma262/#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>evalRealm</var>.[[GlobalEnv]]).</li><li>Let <var>varEnv</var> be <var>evalRealm</var>.[[GlobalEnv]].</li></ol></li><li>If <var>strictEval</var> is <emu-val>true</emu-val>, let <var>varEnv</var> be <var>lexEnv</var>.</li><li>If <var>ctx</var> is not already suspended, suspend <var>ctx</var>.</li><li>Let <var>evalCxt</var> be a new ECMAScript code <emu-xref href="#sec-execution-contexts"><a href="https://tc39.github.io/ecma262/#sec-execution-contexts">execution context</a></emu-xref>.</li><li>Set the <var>evalCxt</var>'s Function to <emu-val>null</emu-val>.</li><li>Set the <var>evalCxt</var>'s <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> to <var>evalRealm</var>.</li><li>Set the <var>evalCxt</var>'s ScriptOrModule to <var>ctx</var>'s ScriptOrModule.</li><li>Set the <var>evalCxt</var>'s VariableEnvironment to <var>varEnv</var>.</li><li>Set the <var>evalCxt</var>'s LexicalEnvironment to <var>lexEnv</var>.</li><li>Push <var>evalCxt</var> on to the <emu-xref href="#execution-context-stack"><a href="https://tc39.github.io/ecma262/#execution-context-stack">execution context stack</a></emu-xref>; <var>evalCxt</var> is now the <emu-xref href="#running-execution-context"><a href="https://tc39.github.io/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>result</var> be <emu-xref aoid="EvalDeclarationInstantiation"><a href="https://tc39.github.io/ecma262/#sec-evaldeclarationinstantiation">EvalDeclarationInstantiation</a></emu-xref>(<var>body</var>, <var>varEnv</var>, <var>lexEnv</var>, <var>strictEval</var>).</li><li>If <var>result</var>.[[Type]] is <emu-const>normal</emu-const>, then<ol><li>Let <var>result</var> be the result of evaluating <var>body</var>.</li></ol></li><li>If <var>result</var>.[[Type]] is <emu-const>normal</emu-const> and <var>result</var>.[[Value]] is <emu-const>empty</emu-const>, then<ol><li>Let <var>result</var> be <emu-xref aoid="NormalCompletion"><a href="https://tc39.github.io/ecma262/#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></li><li>Suspend <var>evalCxt</var> and remove it from the <emu-xref href="#execution-context-stack"><a href="https://tc39.github.io/ecma262/#execution-context-stack">execution context stack</a></emu-xref>.</li><li>Resume the context that is now on the top of the <emu-xref href="#execution-context-stack"><a href="https://tc39.github.io/ecma262/#execution-context-stack">execution context stack</a></emu-xref> as the <emu-xref href="#running-execution-context"><a href="https://tc39.github.io/ecma262/#running-execution-context">running execution context</a></emu-xref>.</li><li>Return <emu-xref aoid="Completion"><a href="https://tc39.github.io/ecma262/#sec-completion-record-specification-type">Completion</a></emu-xref>(<var>result</var>).
</li></ol></emu-alg>
<emu-note><span class="note">Note</span>
<p>The eval code cannot instantiate variable or function bindings in the variable environment of the calling context that invoked the eval if the calling context is evaluating formal parameter initializers or if either the code of the calling context or the eval code is <emu-xref href="#sec-strict-mode-code"><a href="https://tc39.github.io/ecma262/#sec-strict-mode-code">strict mode code</a></emu-xref>. Instead such bindings are instantiated in a new VariableEnvironment that is only accessible to the eval code. Bindings introduced by <code>let</code>, <code>const</code>, or <code>class</code> declarations are always instantiated in a new LexicalEnvironment.</p>
</emu-note>
</emu-clause>
<emu-clause id="sec-realm-objects">
<h1><span class="secnum">2</span>Realm Objects<span class="utils"><span class="anchor"><a href="#sec-realm-objects">#</a></span></span></h1>
<emu-clause id="sec-realm-abstract-operations">
<h1><span class="secnum">2.1</span>Realm Abstract Operations<span class="utils"><span class="anchor"><a href="#sec-realm-abstract-operations">#</a></span></span></h1>
<emu-clause id="sec-preparefordirecteval" aoid="PrepareForDirectEval">
<h1><span class="secnum">2.1.1</span>PrepareForDirectEval ( <var>x</var>, <var>realmRec</var> )<span class="utils"><span class="anchor"><a href="#sec-preparefordirecteval">#</a></span></span></h1>
<p>The abstract operation PrepareForDirectEval with arguments <var>x</var> and <var>realmRec</var> performs the following steps:</p>
<emu-alg><ol><li>Assert: realm is a <emu-xref href="#realm-record"><a href="https://tc39.github.io/ecma262/#realm-record">Realm Record</a></emu-xref>.</li><li>Let <var>fn</var> be <var>realmRec</var>.[[DirectEval]].</li><li>If <var>fn</var> is <emu-val>undefined</emu-val>, return <var>x</var>.</li><li>Assert: <emu-xref aoid="IsCallable"><a href="https://tc39.github.io/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>fn</var>) is <emu-val>true</emu-val>.</li><li>Return ? <emu-xref aoid="Call"><a href="https://tc39.github.io/ecma262/#sec-call">Call</a></emu-xref>(<var>fn</var>, <emu-val>undefined</emu-val>, « <var>x</var> »).
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-prepareforindirecteval" aoid="PrepareForIndirectEval">
<h1><span class="secnum">2.1.2</span>PrepareForIndirectEval ( <var>x</var>, <var>realmRec</var> )<span class="utils"><span class="anchor"><a href="#sec-prepareforindirecteval">#</a></span></span></h1>
<p>The abstract operation PrepareForIndirectEval with arguments <var>x</var> and <var>realmRec</var> performs the following steps:</p>
<emu-alg><ol><li>Assert: realm is a <emu-xref href="#realm-record"><a href="https://tc39.github.io/ecma262/#realm-record">Realm Record</a></emu-xref>.</li><li>Let <var>fn</var> be <var>realmRec</var>.[[IndirectEval]].</li><li>If <var>fn</var> is <emu-val>undefined</emu-val>, return <var>x</var>.</li><li>Assert: <emu-xref aoid="IsCallable"><a href="https://tc39.github.io/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>fn</var>) is <emu-val>true</emu-val>.</li><li>Return ? <emu-xref aoid="Call"><a href="https://tc39.github.io/ecma262/#sec-call">Call</a></emu-xref>(<var>fn</var>, <emu-val>undefined</emu-val>, « <var>x</var> »).
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-extract-realm-methods" aoid="ExtractRealmMethods">
<h1><span class="secnum">2.1.3</span>ExtractRealmMethods ( <var>realmObj</var> )<span class="utils"><span class="anchor"><a href="#sec-extract-realm-methods">#</a></span></span></h1>
When ExtractRealmMethods is called with argument <var>realmObj</var> performs the following steps:
<emu-alg><ol><li>Assert: <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>realmObj</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>Assert: <var>realmObj</var> does have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>realmRec</var> be <var>realmObj</var>.[[Realm]].</li><li>Let <var>directEvalFn</var> be ? <emu-xref aoid="GetMethod"><a href="https://tc39.github.io/ecma262/#sec-getmethod">GetMethod</a></emu-xref>(<var>realmObj</var>, @@directEval).</li><li>If <emu-xref aoid="IsCallable"><a href="https://tc39.github.io/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>directEvalFn</var>) is not <emu-val>true</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>boundDirectEvalFn</var> be <emu-xref aoid="BoundFunctionCreate"><a href="https://tc39.github.io/ecma262/#sec-boundfunctioncreate">BoundFunctionCreate</a></emu-xref>(<var>directEvalFn</var>, <var>realmObj</var>, « »).</li><li>Perform ! <emu-xref aoid="DefinePropertyOrThrow"><a href="https://tc39.github.io/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>boundDirectEvalFn</var>, "length", PropertyDescriptor {[[Value]]: 2, [[Writable]]: <emu-val>false</emu-val>, [[Enumerable]]: <emu-val>false</emu-val>, [[Configurable]]: <emu-val>true</emu-val>}).</li><li>Set <var>realmRec</var>'s [[DirectEval]] internal slot to <var>boundDirectEvalFn</var>.</li><li>Let <var>indirectEvalFn</var> be ? <emu-xref aoid="GetMethod"><a href="https://tc39.github.io/ecma262/#sec-getmethod">GetMethod</a></emu-xref>(<var>realmObj</var>, @@indirectEval).</li><li>If <emu-xref aoid="IsCallable"><a href="https://tc39.github.io/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>indirectEvalFn</var>) is not <emu-val>true</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>boundIndirectEvalFn</var> be <emu-xref aoid="BoundFunctionCreate"><a href="https://tc39.github.io/ecma262/#sec-boundfunctioncreate">BoundFunctionCreate</a></emu-xref>(<var>indirectEvalFn</var>, <var>realmObj</var>, « »).</li><li>Perform ! <emu-xref aoid="DefinePropertyOrThrow"><a href="https://tc39.github.io/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>boundIndirectEvalFn</var>, "length", PropertyDescriptor {[[Value]]: 1, [[Writable]]: <emu-val>false</emu-val>, [[Enumerable]]: <emu-val>false</emu-val>, [[Configurable]]: <emu-val>true</emu-val>}).</li><li>Set <var>realmRec</var>'s [[IndirectEval]] internal slot to <var>boundIndirectEvalFn</var>.
</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-the-realm-constructor">
<h1><span class="secnum">2.2</span>The Realm Constructor<span class="utils"><span class="anchor"><a href="#sec-the-realm-constructor">#</a></span></span></h1>
<p>
The Ream constructor is the %<emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref>% intrinsic object and the initial value of the <emu-val><emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref></emu-val> property of the <emu-xref href="#global-object"><a href="https://tc39.github.io/ecma262/#global-object">global object</a></emu-xref>. When called as a constructor it creates and initializes a new <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> object. <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> is not intended to be called as a function and will throw an exception when called in that manner.
</p>
<p>
The <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> constructor is designed to be subclassable. It may be used as the value in an extends clause of a class definition. Subclass constructors that intend to inherit the specified <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> behaviour must include a super call to the <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> constructor to create and initialize the subclass instance with the internal state necessary to support the Realm.prototype built-in methods.
</p>
<emu-clause id="sec-realm" aoid="Realm">
<h1><span class="secnum">2.2.1</span>Realm ([ <var>target</var>, <var>handler</var> ])<span class="utils"><span class="anchor"><a href="#sec-realm">#</a></span></span></h1>
When Realm is called with arguments <var>target</var> and <var>handler</var> performs the following steps:
<emu-alg><ol><li>If NewTarget is <emu-val>undefined</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>O</var> be ? <emu-xref aoid="OrdinaryCreateFromConstructor"><a href="https://tc39.github.io/ecma262/#sec-ordinarycreatefromconstructor">OrdinaryCreateFromConstructor</a></emu-xref>(NewTarget, "%RealmPrototype%", « [[Realm]] »).</li><li>If <var>handler</var> is provided, then:<ol><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>target</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>handler</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>globalEnv</var> be ? <emu-xref aoid="ProxyCreate"><a href="https://tc39.github.io/ecma262/#sec-proxycreate">ProxyCreate</a></emu-xref>(<var>target</var>, <var>handler</var>).</li></ol></li><li>Else,<ol><li>Let <var>globalEnv</var> be <emu-val>undefined</emu-val>.</li></ol></li><li>Let <var>realmRec</var> be <emu-xref aoid="CreateRealm"><a href="https://tc39.github.io/ecma262/#sec-createrealm">CreateRealm</a></emu-xref>().</li><li>Set <var>O</var>'s [[Realm]] internal slot to <var>realmRec</var>.</li><li>Perform ? <emu-xref aoid="ExtractRealmMethods"><a href="#sec-extract-realm-methods">ExtractRealmMethods</a></emu-xref>(<var>O</var>).</li><li>Perform ? <emu-xref aoid="SetRealmGlobalObject"><a href="https://tc39.github.io/ecma262/#sec-setrealmglobalobject">SetRealmGlobalObject</a></emu-xref>(<var>realmRec</var>, <var>globalEnv</var>, <emu-val>undefined</emu-val>).</li><li>Let <var>init</var> be ? <emu-xref aoid="GetMethod"><a href="https://tc39.github.io/ecma262/#sec-getmethod">GetMethod</a></emu-xref>(<var>O</var>, <emu-val>"init"</emu-val>).</li><li>If <emu-xref aoid="IsCallable"><a href="https://tc39.github.io/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>init</var>) is not <emu-val>true</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Perform ? <emu-xref aoid="Call"><a href="https://tc39.github.io/ecma262/#sec-call">Call</a></emu-xref>(<var>init</var>, <var>O</var>).</li><li>Return <var>O</var>.
</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-the-realm-constructor">
<h1><span class="secnum">2.3</span>Properties of the Realm Constructor<span class="utils"><span class="anchor"><a href="#sec-properties-of-the-realm-constructor">#</a></span></span></h1>
The value of the [[Prototype]] internal slot of the <emu-val><emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref></emu-val> constructor is the intrinsic object <emu-xref href="#sec-properties-of-the-function-constructor"><a href="https://tc39.github.io/ecma262/#sec-properties-of-the-function-constructor">%FunctionPrototype%</a></emu-xref>.
</emu-clause>
<emu-clause id="sec-properties-of-the-realm-prototype-object">
<h1><span class="secnum">2.4</span>Properties of the Realm Prototype Object<span class="utils"><span class="anchor"><a href="#sec-properties-of-the-realm-prototype-object">#</a></span></span></h1>
<emu-clause id="sec-realm.prototype.init">
<h1><span class="secnum">2.4.1</span>Realm.prototype.init ()<span class="utils"><span class="anchor"><a href="#sec-realm.prototype.init">#</a></span></span></h1>
<emu-alg><ol><li>Let <var>O</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>O</var> does not have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Perform ? <emu-xref aoid="SetDefaultGlobalBindings"><a href="https://tc39.github.io/ecma262/#sec-setdefaultglobalbindings">SetDefaultGlobalBindings</a></emu-xref>(<var>O</var>.[[Realm]]).
</li></ol></emu-alg>
<emu-note><span class="note">Note</span>
Extensible web: This is the dynamic way to define globals in a new realm.
</emu-note>
</emu-clause>
<emu-clause id="sec-realm.prototype.eval">
<h1><span class="secnum">2.4.2</span>Realm.prototype.eval ( <var>x</var> )<span class="utils"><span class="anchor"><a href="#sec-realm.prototype.eval">#</a></span></span></h1>
Synchronously execute a top-level script. The <var>x</var> is interpreted as a Script and evaluated with this bound to the realm's <emu-xref href="#global-object"><a href="https://tc39.github.io/ecma262/#global-object">global object</a></emu-xref>.
<emu-alg><ol><li>Let <var>O</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>O</var> does not have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>evalRealm</var> be <var>O</var>.[[Realm]].</li><li>Perform ? HostEnsureCanCompileStrings(<emu-xref href="#current-realm"><a href="https://tc39.github.io/ecma262/#current-realm">the current Realm Record</a></emu-xref>, <var>evalRealm</var>).</li><li>Return ? <emu-xref aoid="PerformEval"><a href="#sec-performeval">PerformEval</a></emu-xref>(<var>x</var>, <var>evalRealm</var>, <emu-val>false</emu-val>, <emu-val>false</emu-val>).
</li></ol></emu-alg>
<emu-note><span class="note">Note</span>
Extensible web: This is the dynamic equivalent of a <script> in HTML.
</emu-note>
</emu-clause>
<emu-clause id="sec-realm.prototype-@@directEval">
<h1><span class="secnum">2.4.3</span>Realm.prototype [ @@directEval ] ( <var>x</var> )<span class="utils"><span class="anchor"><a href="#sec-realm.prototype-@@directEval">#</a></span></span></h1>
<emu-alg><ol><li>Let <var>O</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>O</var> does not have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Return <var>x</var>.
</li></ol></emu-alg>
<emu-note><span class="note">Note</span>
Extensible web: This is the hook to pre-process <var>x</var> as the code to be evaluated by calling <code>eval()</code>.
</emu-note>
</emu-clause>
<emu-clause id="sec-realm.prototype-@@indirectEval">
<h1><span class="secnum">2.4.4</span>Realm.prototype [ @@indirectEval ] ( <var>x</var> )<span class="utils"><span class="anchor"><a href="#sec-realm.prototype-@@indirectEval">#</a></span></span></h1>
<emu-alg><ol><li>Let <var>O</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>O</var> does not have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Return <var>x</var>.
</li></ol></emu-alg>
<emu-note><span class="note">Note</span>
Extensible web: This is the hook to pre-process <var>x</var> as the code to be evaluated by calling a reference to the <code>eval</code> function.
</emu-note>
</emu-clause>
<emu-clause id="sec-realm.prototype.global">
<h1><span class="secnum">2.4.5</span>get Realm.prototype.global<span class="utils"><span class="anchor"><a href="#sec-realm.prototype.global">#</a></span></span></h1>
Realm.prototype.global is an accessor property whose set accessor function is <emu-val>undefined</emu-val>. Its get accessor function performs the following steps:
<emu-alg><ol><li>Let <var>O</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>O</var> does not have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Return <var>O</var>.[[Realm]].[[GlobalObject]].
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-realm.prototype.stdlib">
<h1><span class="secnum">2.4.6</span>get Realm.prototype.stdlib<span class="utils"><span class="anchor"><a href="#sec-realm.prototype.stdlib">#</a></span></span></h1>
Realm.prototype.stdlib is an accessor property whose set accessor function is <emu-val>undefined</emu-val>. Its get accessor function performs the following steps:
<emu-alg><ol><li>Let <var>O</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>O</var> does not have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>realmRec</var> be <var>O</var>.[[Realm]].</li><li>Let global be realmRec.[[GlobalObject]].</li><li>Let <var>stdlib</var> be <emu-xref aoid="ObjectCreate"><a href="https://tc39.github.io/ecma262/#sec-objectcreate">ObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object">%ObjectPrototype%</a></emu-xref>).</li><li>For each property of the Global Object specified in clause <emu-xref href="#sec-global-object"><a href="https://tc39.github.io/ecma262/#sec-global-object">18</a></emu-xref> that correspond to an intrinsic object, do:<ol><li>Let <var>name</var> be the String value of the property name.</li><li>Let <var>value</var> be the corresponding value of the intrinsic object from record <var>realmRec</var>.[[Intrinsics]].</li><li>Let <var>descObj</var> be <emu-xref aoid="ObjectCreate"><a href="https://tc39.github.io/ecma262/#sec-objectcreate">ObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object">%ObjectPrototype%</a></emu-xref>).</li><li>Perform ? <emu-xref aoid="DefinePropertyOrThrow"><a href="https://tc39.github.io/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>descObj</var>, <emu-val>"value"</emu-val>, PropertyDescriptor{[[Value]]: <var>value</var>, [[Writable]]: <emu-val>true</emu-val>, [[Enumerable]]: <emu-val>true</emu-val>, [[Configurable]]: <emu-val>true</emu-val>}).</li><li>Perform ? <emu-xref aoid="DefinePropertyOrThrow"><a href="https://tc39.github.io/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>stdlib</var>, <var>name</var>, PropertyDescriptor{[[Value]]: <var>descObj</var>, [[Writable]]: <emu-val>true</emu-val>, [[Enumerable]]: <emu-val>true</emu-val>, [[Configurable]]: <emu-val>true</emu-val>}).</li></ol></li><li>Return <var>stdlib</var>.
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-realm.prototype.intrinsics">
<h1><span class="secnum">2.4.7</span>get Realm.prototype.intrinsics<span class="utils"><span class="anchor"><a href="#sec-realm.prototype.intrinsics">#</a></span></span></h1>
Realm.prototype.intrinsics is an accessor property whose set accessor function is <emu-val>undefined</emu-val>. Its get accessor function performs the following steps:
<emu-alg><ol><li>Let <var>O</var> be <emu-val>this</emu-val> value.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>O</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <var>O</var> does not have an [[Realm]] internal slot, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>realmRec</var> be <var>O</var>.[[Realm]].</li><li>Let <var>intrinsics</var> be <emu-xref aoid="ObjectCreate"><a href="https://tc39.github.io/ecma262/#sec-objectcreate">ObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object">%ObjectPrototype%</a></emu-xref>).</li><li>For each intrinsic name listed in <emu-xref href="#table-7"><a href="https://tc39.github.io/ecma262/#table-7">Table 7</a></emu-xref>, do:<ol><li>Let <var>intrinsicName</var> be the String value in column one of the table.</li><li>Let <var>name</var> be the String value of <var>intrinsicName</var> without the <emu-val>%</emu-val> symbols.</li><li>Let <var>value</var> be the value of the field name <var>intrisicName</var> from record <var>realmRec</var>.[[Intrinsics]].</li><li>Perform ? <emu-xref aoid="DefinePropertyOrThrow"><a href="https://tc39.github.io/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>intrinsics</var>, <var>name</var>, PropertyDescriptor{[[Value]]: <var>value</var>, [[Writable]]: <emu-val>true</emu-val>, [[Enumerable]]: <emu-val>true</emu-val>, [[Configurable]]: <emu-val>true</emu-val>}).</li></ol></li><li>Return <var>intrinsics</var>.
</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-realm.prototype-@@tostringtag">
<h1><span class="secnum">2.4.8</span>Realm.prototype [ @@toStringTag ]<span class="utils"><span class="anchor"><a href="#sec-realm.prototype-@@tostringtag">#</a></span></span></h1>
The initial value of the @@toStringTag property is the String value "<emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref>". This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-realm-instances">
<h1><span class="secnum">2.5</span>Properties of Realm Instances<span class="utils"><span class="anchor"><a href="#sec-properties-of-realm-instances">#</a></span></span></h1>
<emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> instances are ordinary objects that inherit properties from the <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> prototype object (the intrinsic, %RealmPrototype%). <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> instances are initially created with the internal slots described in <emu-xref href="#table-3"><a href="#table-3">Table 4</a></emu-xref>.
<emu-table id="table-3" caption="Internal Slots of Realm Instances"><figure><figcaption>Table 4: Internal Slots of <emu-xref aoid="Realm"><a href="#sec-realm">Realm</a></emu-xref> Instances</figcaption>
<table>
<tbody>
<tr>
<th>Internal Slot</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>[[Realm]]</td>
<td><emu-xref href="#realm-record"><a href="https://tc39.github.io/ecma262/#realm-record">Realm Record</a></emu-xref></td>
<td>The <emu-xref href="#realm-record"><a href="https://tc39.github.io/ecma262/#realm-record">Realm Record</a></emu-xref> for the initial <emu-xref href="#sec-execution-contexts"><a href="https://tc39.github.io/ecma262/#sec-execution-contexts">execution context</a></emu-xref>.</td>
</tr>
</tbody>
</table>
</figure></emu-table>
</emu-clause>
</emu-clause>
</body>