forked from tc39/proposal-shadowrealm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.emu
438 lines (390 loc) · 22.9 KB
/
index.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
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!doctype html>
<meta charset="utf8">
<link href="ecmarkup.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="ecmarkup.js"></script>
<pre class=metadata>
title: ECMAScript Realms Spec Proposal
stage: 0
contributors: Dave Herman, Caridy Patiño, Mark Miller
status: draft
copyright: false
location: https://rawgit.com/tc39/proposal-realms/master/index.html
</pre>
<emu-table id="table-1" caption="Well-known Intrinsic Objects">
<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>
</emu-table>
<!-- es6num="8.2" -->
<emu-clause id="sec-code-realms">
<h1>Realms</h1>
<emu-table id="table-21" caption="Realm Record Fields">
<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>[[TransformTrap]]</td>
<td>A function object or *undefined*</td>
<td>The function that is used as the transform trap. If [[TransformTrap]] is undefined, the trap invoker will carry on the default behavior.</td>
</tr>
<tr>
<td>[[IsDirectEvalTrap]]</td>
<td>A function object or *undefined*</td>
<td>The function that is used as the direct eval check trap. If [[IsDirectEvalTrap]] is undefined, the trap invoker will carry on the default behavior.</td>
</tr>
<tr>
<td>[[PreventImportExpression]]</td>
<td>A boolean value</td>
<td>Whether or not import declarations or expressions are allowed. Default to *false*.</td>
</tr>
</tbody>
</table>
</emu-table>
<emu-clause id="sec-invokeisdirectevaltrap" aoid="InvokeIsDirectEvalTrap">
<h1>InvokeIsDirectEvalTrap( _trap_, _func_ )</h1>
<p>The abstract operation InvokeIsDirectEvalTrap with arguments _trap_ and _func_ performs the following steps:</p>
<emu-alg>
1. Assert: IsCallable(_trap_) is *true*.
1. Let _result_ be ToBoolean( ? Call(_trap_, *undefined*, « _func_ »)).
1. Return _result_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-invoketransformtrap" aoid="InvokeTransformTrap">
<h1>InvokeTransformTrap ( _trap_, _sourceText_ )</h1>
<p>The abstract operation InvokeTransformTrap with arguments _trap_ and _sourceText_ performs the following steps:</p>
<emu-alg>
1. Assert: IsCallable(_trap_) is *true*.
1. Let _newSourceText_ be ? Call(_trap_, *undefined*, « _sourceText_ »).
1. Return ? ToString(_newSourceText_).
</emu-alg>
</emu-clause>
</emu-clause>
<!-- es6num="18.2.1.1" -->
<emu-clause id="sec-performeval" aoid="PerformEval">
<h1>Runtime Semantics: PerformEval ( _x_, _evalRealm_, _strictCaller_, _direct_ )</h1>
<p>The abstract operation PerformEval with arguments _x_, _evalRealm_, _strictCaller_, and _direct_ performs the following steps:</p>
<emu-alg>
1. Assert: If _direct_ is *false*, then _strictCaller_ is also *false*.
1. If Type(_x_) is not String, return _x_.
1. <ins>Let _fn_ be _evalRealm_.[[TransformTrap]]</ins>.
1. <ins>If IsCallable(_fn_) is *true*, then</ins>
1. <ins>Let _x_ be ? InvokeTransformTrap(_fn_, _x_).</ins>.
1. Let _thisEnvRec_ be ! GetThisEnvironment().
1. If _thisEnvRec_ is a function Environment Record, then
1. Let _F_ be _thisEnvRec_.[[FunctionObject]].
1. Let _inFunction_ be *true*.
1. Let _inMethod_ be _thisEnvRec_.HasSuperBinding().
1. If _F_.[[ConstructorKind]] is `"derived"`, let _inDerivedConstructor_ be *true*; otherwise, let _inDerivedConstructor_ be *false*.
1. Else,
1. Let _inFunction_ be *false*.
1. Let _inMethod_ be *false*.
1. Let _inDerivedConstructor_ be *false*.
1. <ins>Let _preventImport_ is _evalRealm_.[[PreventImportExpression]]</ins>.
1. Let _script_ be the ECMAScript code that is the result of parsing _x_, interpreted as UTF-16 encoded Unicode text as described in <emu-xref href="#sec-ecmascript-language-types-string-type"></emu-xref>, for the goal symbol |Script|. <ins>If _preventImport_ is *true*, additional early error rules from <emu-xref href="#sec-import-early-errors"></emu-xref> are applied. </ins>If _inFunction_ is *false*, additional early error rules from <emu-xref href="#sec-performeval-rules-outside-functions"></emu-xref> are applied. If _inMethod_ is *false*, additional early error rules from <emu-xref href="#sec-performeval-rules-outside-methods"></emu-xref> are applied. If _inDerivedConstructor_ is *false*, additional early error rules from <emu-xref href="#sec-performeval-rules-outside-constructors"></emu-xref> are applied. If the parse fails, throw a *SyntaxError* exception. If any early errors are detected, throw a *SyntaxError* or a *ReferenceError* exception, depending on the type of the error (but see also clause <emu-xref href="#sec-error-handling-and-language-extensions"></emu-xref>). Parsing and early error detection may be interweaved in an implementation-dependent manner.
1. If _script_ Contains |ScriptBody| is *false*, return *undefined*.
1. Let _body_ be the |ScriptBody| of _script_.
1. If _strictCaller_ is *true*, let _strictEval_ be *true*.
1. Else, let _strictEval_ be IsStrict of _script_.
1. Let _ctx_ be the running execution context.
1. NOTE: If _direct_ is *true*, _ctx_ will be the execution context that performed the direct eval. If _direct_ is *false*, _ctx_ will be the execution context for the invocation of the `eval` function.
1. If _direct_ is *true*, then
1. Let _lexEnv_ be NewDeclarativeEnvironment(_ctx_'s LexicalEnvironment).
1. Let _varEnv_ be _ctx_'s VariableEnvironment.
1. Else,
1. Let _lexEnv_ be NewDeclarativeEnvironment(_evalRealm_.[[GlobalEnv]]).
1. Let _varEnv_ be _evalRealm_.[[GlobalEnv]].
1. If _strictEval_ is *true*, set _varEnv_ to _lexEnv_.
1. If _ctx_ is not already suspended, suspend _ctx_.
1. Let _evalCxt_ be a new ECMAScript code execution context.
1. Set the _evalCxt_'s Function to *null*.
1. Set the _evalCxt_'s Realm to _evalRealm_.
1. Set the _evalCxt_'s ScriptOrModule to _ctx_'s ScriptOrModule.
1. Set the _evalCxt_'s VariableEnvironment to _varEnv_.
1. Set the _evalCxt_'s LexicalEnvironment to _lexEnv_.
1. Push _evalCxt_ on to the execution context stack; _evalCxt_ is now the running execution context.
1. Let _result_ be EvalDeclarationInstantiation(_body_, _varEnv_, _lexEnv_, _strictEval_).
1. If _result_.[[Type]] is ~normal~, then
1. Set _result_ to the result of evaluating _body_.
1. If _result_.[[Type]] is ~normal~ and _result_.[[Value]] is ~empty~, then
1. Set _result_ to NormalCompletion(*undefined*).
1. Suspend _evalCxt_ and remove it from the execution context stack.
1. Resume the context that is now on the top of the execution context stack as the running execution context.
1. Return Completion(_result_).
</emu-alg>
<!-- es6num="18.2.1.1.3" -->
<emu-clause id="sec-import-early-errors">
<h1>Additional Early Error Rules for Eval in Realms</h1>
<p>These static semantics are applied by PerformEval and PerformRealmEvaluation when evaluating code in a Realm Record associated to a Realm Object.</p>
<emu-grammar>CallExpression : ImportCall</emu-grammar>
<ul>
<li>It is a Reference Error if the Realm Record Field Name [[PreventImportExpression]] has the value of *true*.</li>
</ul>
</emu-clause>
</emu-clause>
<!-- es6num="12.3.4.1" -->
<emu-clause id="sec-function-calls-runtime-semantics-evaluation">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>CallExpression : CoverCallExpressionAndAsyncArrowHead</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredCallExpression of CoverCallExpressionAndAsyncArrowHead.
1. Let _memberExpr_ be the MemberExpression of _expr_.
1. Let _arguments_ be the Arguments of _expr_.
1. Let _ref_ be the result of evaluating _memberExpr_.
1. Let _func_ be ? GetValue(_ref_).
1. If Type(_ref_) is Reference and IsPropertyReference(_ref_) is *false* and GetReferencedName(_ref_) is `"eval"`, then
1. <ins>Let _evalRealm_ be the current Realm Record.</ins>.
1. <ins>Let _trapFn_ be _evalRealm_.[[IsDirectEvalTrap]]</ins>.
1. <ins>If IsCallable(_trapFn_) is *true*, then</ins>
1. <ins>Let _isDirectEval_ be ? InvokeIsDirectEvalTrap(_trapFn_, _func_).</ins>.
1. <ins>Else</ins>,
1. <ins>Let _isDirectEval_ be SameValue(_func_, %eval%)</ins>.
1. If <ins>_isDirectEval_</ins><del>SameValue(_func_, %eval%)</del> is *true*, then
1. Let _argList_ be ? ArgumentListEvaluation(_arguments_).
1. If _argList_ has no elements, return undefined.
1. Let _evalText_ be the first element of _argList_.
1. If the source code matching this CallExpression is strict mode code, let _strictCaller_ be *true*. Otherwise let strictCaller be *false*.
1. <del>Let evalRealm be the current Realm Record</del>.
1. Perform ? HostEnsureCanCompileStrings(_evalRealm_, _evalRealm_).
1. Return ? PerformEval(_evalText_, _evalRealm_, _strictCaller_, *true*).
1. Let _thisCall_ be this CallExpression.
1. Let _tailCall_ be IsInTailPosition(_thisCall_).
1. Return ? EvaluateCall(_func_, _ref_, _arguments_, _tailCall_).
</emu-alg>
</emu-clause>
<!-- es6num="15.1.9" -->
<emu-clause id="sec-parse-script" aoid="ParseScript">
<h1>ParseScript ( _sourceText_, _realm_, _hostDefined_ )</h1>
<p>The abstract operation ParseScript with arguments _sourceText_, _realm_, and _hostDefined_ creates a Script Record based upon the result of parsing _sourceText_ as a |Script|. ParseScript performs the following steps:</p>
<emu-alg>
1. Assert: _sourceText_ is an ECMAScript source text (see clause <emu-xref href="#sec-ecmascript-language-source-code"></emu-xref>).
1. <ins>Let _preventImport_ is _realm_.[[PreventImportExpression]]</ins>.
1. Parse _sourceText_ using |Script| as the goal symbol and analyse the parse result for any Early Error conditions. <ins>If _preventImport_ is *true*, additional early error rules from <emu-xref href="#sec-import-early-errors"></emu-xref> are applied. </ins>If the parse was successful and no early errors were found, let _body_ be the resulting parse tree. Otherwise, let _body_ be a List of one or more *SyntaxError* or *ReferenceError* objects representing the parsing errors and/or early errors. Parsing and early error detection may be interweaved in an implementation-dependent manner. If more than one parsing error or early error is present, the number and ordering of error objects in the list is implementation-dependent, but at least one must be present.
1. If _body_ is a List of errors, return _body_.
1. Return Script Record {[[Realm]]: _realm_, [[Environment]]: *undefined*, [[ECMAScriptCode]]: _body_, [[HostDefined]]: _hostDefined_}.
</emu-alg>
</emu-clause>
<emu-clause id="sec-realm-objects">
<h1>Realm Objects</h1>
<emu-clause id="sec-realm-abstract-operations">
<h1>Realm Abstract Operations</h1>
<emu-clause id="sec-create-realm-rec" aoid="CreateRealmRec">
<h1>CreateRealmRec ( _intrinsics_ )</h1>
<emu-alg>
1. Let _realmRec_ be a new Realm Record.
1. If _intrinsics_ is *undefined*, then
1. Perform CreateIntrinsics(_realmRec_).
1. Else
1. Assert: In this case, _intrinsics_ must be a Record with field names listed in column one of Table 7.
1. Set _realmRec_.[[Intrinsics]] to _intrinsics_.
1. Set _realmRec_.[[GlobalObject]] to *undefined*.
1. Set _realmRec_.[[GlobalEnv]] to *undefined*.
1. Set _realmRec_.[[TemplateMap]] to a new empty List.
1. Return _realmRec_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-performRealmEvaluation" aoid="PerformRealmEvaluation">
<h1>PerformRealmEvaluation ( _x_, _evalRealm_ )</h1>
<emu-alg>
1. Assert: Type(_x_) is String.
1. Assert: _evalRealm_ is a Realm Record.
1. Let _hostDefined_ be _evalRealm_.[[HostDefined]].
1. Let _s_ be ParseScript(_x_, _evalRealm_, _hostDefined_).
1. If _s_ is a List of errors, then
1. Perform HostReportErrors(_s_).
1. Return NormalCompletion(*undefined*).
1. Return ? ScriptEvaluation(_s_).
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-the-realm-constructor">
<h1>The Realm Constructor</h1>
<p>
The Ream constructor is the %Realm% intrinsic object and the initial value of the *Realm* property of the global object. When called as a constructor it creates and initializes a new Realm object. Realm is not intended to be called as a function and will throw an exception when called in that manner.
</p>
<p>
The Realm 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 Realm behaviour must include a super call to the Realm 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>Realm ([ _options_ ])</h1>
When Realm is called with argument _option_ performs the following steps:
<emu-alg>
1. If NewTarget is *undefined*, throw a *TypeError* exception.
1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, "%RealmPrototype%", « [[Realm]] »).
1. If _options_ is not *undefined*, then
1. Let _parentRealm_ be the current Realm Record.
1. Let _opts_ be ? ToObject(_options_).
1. Let _transformTrap_ be ? Get(_opts_, "transform").
1. If _transformTrap_ is equal `"inherit"`, then
1. Set _transformTrap_ to _parentRealm_.[[TransformTrap]].
1. Else if _transformTrap_ is not *undefined* and IsCallable(_transformTrap_) is *false*, throw a TypeError exception.
1. Let _isDirectEvalTrap_ be ? Get(_opts_, "isDirectEval").
1. If _isDirectEvalTrap_ is equal `"inherit"`, then
1. Set _isDirectEvalTrap_ to _parentRealm_.[[IsDirectEvalTrap]].
1. Else if _isDirectEvalTrap_ is not *undefined* and IsCallable(_isDirectEvalTrap_) is *false*, throw a TypeError exception.
1. Let _intrinsics_ be ? Get(_opts_, "intrinsics").
1. If _intrinsics_ is equal `"inherit"`, then
1. Set _intrinsics_ to _parentRealm_.[[Intrinsics]].
1. Else if _intrinsics_ is not *undefined*, throw a TypeError exception.
1. Let _thisValue_ be ? Get(_opts_, "thisValue").
1. If _thisValue_ is not *undefined* and Type(_thisValue_) is not Object, throw a TypeError exception.
1. Let _realmRec_ be CreateRealmRec(_intrinsics_).
1. Set _O_.[[Realm]] to _realmRec_.
1. Perform ? SetRealmGlobalObject(_realmRec_, *undefined*, _thisValue_).
1. Set _realmRec_.[[PreventImportExpression]] to *true*.
1. If _transformTrap_ is not *undefined*, then
1. Set _realmRec_.[[TransformTrap]] to _transformTrap_.
1. If _isDirectEvalTrap_ is not *undefined*, then
1. Set _realmRec_.[[IsDirectEvalTrap]] to _isDirectEvalTrap_.
1. Let _init_ be ? GetMethod(_O_, *"init"*).
1. If IsCallable(_init_) is not *true*, throw a *TypeError* exception.
1. Perform ? Call(_init_, _O_).
1. Return _O_.
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-the-realm-constructor">
<h1>Properties of the Realm Constructor</h1>
The value of the [[Prototype]] internal slot of the *Realm* constructor is the intrinsic object %FunctionPrototype%.
</emu-clause>
<emu-clause id="sec-properties-of-the-realm-prototype-object">
<h1>Properties of the Realm Prototype Object</h1>
<emu-clause id="sec-realm.prototype.init">
<h1>Realm.prototype.init ()</h1>
<emu-alg>
1. Let _O_ be *this* value.
1. If Type(_O_) is not Object, throw a *TypeError* exception.
1. If _O_ does not have an [[Realm]] internal slot, throw a *TypeError* exception.
1. Perform ? SetDefaultGlobalBindings(_O_.[[Realm]]).
</emu-alg>
<emu-note>
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>Realm.prototype.evaluate ( _sourceText_ )</h1>
Synchronously execute a top-level script. The _x_ is interpreted as a Script and evaluated with this bound to the realm's global object.
<emu-alg>
1. Let _O_ be *this* value.
1. If Type(_O_) is not Object, throw a *TypeError* exception.
1. If _O_ does not have an [[Realm]] internal slot, throw a *TypeError* exception.
1. If Type(_sourceText_) is not String, throw a *TypeError* exception.
1. Let _realm_ be _O_.[[Realm]].
1. Return ? PerformRealmEvaluation(_sourceText_, _realm_).
</emu-alg>
<emu-note>
Extensible web: This is the dynamic equivalent of a <script> in HTML.
</emu-note>
<emu-note>
Invocation of this method does not transform _x_ via the [[TransformTrap]].
</emu-note>
</emu-clause>
<emu-clause id="sec-realm.prototype.global">
<h1>get Realm.prototype.global</h1>
Realm.prototype.global is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
<emu-alg>
1. Let _O_ be *this* value.
1. If Type(_O_) is not Object, throw a *TypeError* exception.
1. If _O_ does not have an [[Realm]] internal slot, throw a *TypeError* exception.
1. Return _O_.[[Realm]].[[GlobalObject]].
</emu-alg>
</emu-clause>
<emu-clause id="sec-realm.prototype.thisValue">
<h1>get Realm.prototype.thisValue</h1>
Realm.prototype.thisValue is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
<emu-alg>
1. Let _O_ be *this* value.
1. If Type(_O_) is not Object, throw a *TypeError* exception.
1. If _O_ does not have an [[Realm]] internal slot, throw a *TypeError* exception.
1. Let _envRec_ be _O_.[[Realm]].[[GlobalEnv]].
1. Return _envRec_.[[GlobalThisValue]].
</emu-alg>
</emu-clause>
<emu-clause id="sec-realm.prototype.stdlib">
<h1>get Realm.prototype.stdlib</h1>
Realm.prototype.stdlib is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
<emu-alg>
1. Let _O_ be *this* value.
1. If Type(_O_) is not Object, throw a *TypeError* exception.
1. If _O_ does not have an [[Realm]] internal slot, throw a *TypeError* exception.
1. Let _realmRec_ be _O_.[[Realm]].
1. Let global be realmRec.[[GlobalObject]].
1. Let _stdlib_ be ObjectCreate(%ObjectPrototype%).
1. For each property of the Global Object specified in clause <emu-xref href="#sec-global-object"></emu-xref> that correspond to an intrinsic object, do:
1. Let _name_ be the String value of the property name.
1. Let _value_ be the corresponding value of the intrinsic object from record _realmRec_.[[Intrinsics]].
1. Let _descObj_ be ObjectCreate(%ObjectPrototype%).
1. Perform ? DefinePropertyOrThrow(_descObj_, *"value"*, PropertyDescriptor{[[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true*}).
1. Perform ? DefinePropertyOrThrow(_stdlib_, _name_, PropertyDescriptor{[[Value]]: _descObj_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true*}).
1. Return _stdlib_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-realm.prototype.intrinsics">
<h1>get Realm.prototype.intrinsics</h1>
Realm.prototype.intrinsics is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
<emu-alg>
1. Let _O_ be *this* value.
1. If Type(_O_) is not Object, throw a *TypeError* exception.
1. If _O_ does not have an [[Realm]] internal slot, throw a *TypeError* exception.
1. Let _realmRec_ be _O_.[[Realm]].
1. Let _intrinsics_ be ObjectCreate(%ObjectPrototype%).
1. For each intrinsic name listed in <emu-xref href="#table-7"></emu-xref>, do:
1. Let _intrinsicName_ be the String value in column one of the table.
1. Let _name_ be the String value of _intrinsicName_ without the *%* symbols.
1. Let _value_ be the value of the field name _intrisicName_ from record _realmRec_.[[Intrinsics]].
1. Perform ? DefinePropertyOrThrow(_intrinsics_, _name_, PropertyDescriptor{[[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true*}).
1. Return _intrinsics_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-realm.prototype-@@tostringtag">
<h1>Realm.prototype [ @@toStringTag ]</h1>
The initial value of the @@toStringTag property is the String value "Realm".
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
</emu-clause>
</emu-clause>
<emu-clause id="sec-properties-of-realm-instances">
<h1>Properties of Realm Instances</h1>
Realm instances are ordinary objects that inherit properties from the Realm prototype object (the intrinsic, %RealmPrototype%). Realm instances are initially created with the internal slots described in <emu-xref href="#table-3"></emu-xref>.
<emu-table id="table-3" caption="Internal Slots of Realm Instances">
<table>
<tbody>
<tr>
<th>Internal Slot</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>[[Realm]]</td>
<td>Realm Record</td>
<td>The Realm Record for the initial execution context.</td>
</tr>
</tbody>
</table>
</emu-table>
</emu-clause>
</emu-clause>