Skip to content

Commit

Permalink
Layering: Host hook to initialize new Realms (#230)
Browse files Browse the repository at this point in the history
* Layering: Host hook to initialize new Realms

Part of addressing #225

In HTML, this host hook would probably do something related to [setting up a window environment settings object](https://html.spec.whatwg.org/#set-up-a-window-environment-settings-object). I wouldn't propose that this would add properties to the global object in HTML.

This PR makes a new host hook section, as another hook may be needed for new modules (in the context of #224)

* Note the purpose of the hook
  • Loading branch information
Daniel Ehrenberg authored Feb 29, 2020
1 parent 51a591b commit 3f7ea64
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/index.emu
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ location: https://rawgit.com/tc39/proposal-realms/master/index.html
1. Set _O_.[[Realm]] to _realmRec_.
1. Perform ? SetRealmGlobalObject(_realmRec_, *undefined*, *undefined*).
1. Perform ? SetDefaultGlobalBindings(_O_.[[Realm]]).
1. Perform ? HostInitializeUserRealm(_O_.[[Realm]]).
1. Return _O_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -151,5 +152,21 @@ location: https://rawgit.com/tc39/proposal-realms/master/index.html
</emu-table>

</emu-clause>

<emu-clause id="sec-realm-host-operations">
<h1>Host operations</h1>
<emu-clause id="sec-host-initialize-user-realm">
<h1>Runtime Semantics: HostInitializeUserRealm ( _realm_ )</h1>
<p>
HostInitializerUserRealm is an implementation-defined abstract
operation used to inform the host of any newly created realms from
the Realm constructor. Its return value is not used, though it may
throw an exception. The idea of this hook is to initialize host
data structures related to the Realm, e.g., for module loading. It
is not expected that this hook would add properties to the Realm's
global object.
</p>
</emu-clause>
</emu-clause>

</emu-clause>

0 comments on commit 3f7ea64

Please sign in to comment.