Skip to content

Commit

Permalink
Require and assert that the global object inside the Shadow Realm is …
Browse files Browse the repository at this point in the history
…ordinary. (#413)

Co-authored-by: Mathieu Hofman <[email protected]>
  • Loading branch information
Ms2ger and mhofman authored Nov 25, 2024
1 parent f20d027 commit 629dd62
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ <h1>ShadowRealm ( )</h1>
1. Let _realmRec_ be the Realm of _innerContext_.
1. Set _O_.[[ShadowRealm]] to _realmRec_.
1. Perform ? HostInitializeShadowRealm(_realmRec_, _innerContext_, _O_).
1. Assert: _realmRec_.[[GlobalObject]] is an ordinary object.
1. Return _O_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -612,10 +613,6 @@ <h1>
to the ShadowRealm, e.g., for module loading.
</dd>
</dl>
<p>
The host may use this hook to add properties to the ShadowRealm's global
object. Those properties must be configurable.
</p>
<emu-note>
<p>
This specification does not recommend any specific addition.
Expand All @@ -626,13 +623,13 @@ <h1>
including `HTMLElement`, `localStorage`, `fetch`, etc.
</p>
</emu-note>
<emu-note type=editor>
<p>
The ShadowRealm constructor (<emu-xref href="#sec-shadowrealm"></emu-xref>)
creates a new global object as an ordinary object. This
means all properties from the global object are deletable.
</p>
</emu-note>
</emu-clause>
<emu-clause id="sec-shadowrealm-host-requirements">
<h1>Requirements on host-defined global objects</h1>
<p>
If a host defines that a specific global object is to be used for a ShadowRealm, that
object must be an extensible ordinary object, and any properties on it must be configurable.
</p>
</emu-clause>
</emu-clause>
</emu-clause>
Expand Down

0 comments on commit 629dd62

Please sign in to comment.