Skip to content

Commit c705ce6

Browse files
committed
Formally define a [[Realm]] slot on platform objects
Note that this slot was already used in assertions for the result of the [Constructor] and [NamedConstructor] implementation algorithms. Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=24652.
1 parent 7bbff53 commit c705ce6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.bs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12373,11 +12373,14 @@ The value of the [=function object=]’s <code class="idl">name</code> property
1237312373
in various ways, including "|object| is an |interface| object".
1237412374
</div>
1237512375

12376-
Every [=platform object=] is associated with a global environment, just
12376+
Every [=platform object=] is associated with a [=Realm=], just
1237712377
as the [=initial objects=] are.
12378+
This Realm is stored in the [=platform object=]'s \[[Realm]] slot.
1237812379
It is the responsibility of specifications using Web IDL to state
12379-
which global environment (or, by proxy, which global object) each platform
12380+
which Realm (or, by proxy, which global object) each platform
1238012381
object is associated with.
12382+
In particular, the algorithms below associate the new [=platform object=] with
12383+
the Realm given as an argument.
1238112384

1238212385
<div algorithm>
1238312386
To <dfn export lt=new>create a new object implementing the interface</dfn> |interface|, with a
@@ -12403,9 +12406,10 @@ object is associated with.
1240312406
1. Let |targetRealm| be [$GetFunctionRealm$](|newTarget|).
1240412407
1. Set |prototype| to the [=interface prototype object=] for |interface| in
1240512408
|targetRealm|.
12406-
1. Let |slots| be « \[[PrimaryInterface]] ».
12409+
1. Let |slots| be « \[[Realm]], \[[PrimaryInterface]] ».
1240712410
1. Let |instance| be a newly created [=ECMAScript/object=] in |realm|
1240812411
with an internal slot for each name in |slots|.
12412+
1. Set |instance|.\[[Realm]] to |realm|.
1240912413
1. Set |instance|.\[[PrimaryInterface]] to |interface|.
1241012414
1. Set |instance|.\[[Prototype]] to |prototype|.
1241112415
1. Set |instance|'s essential internal methods to the definitions specified in

0 commit comments

Comments
 (0)