Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layering: Host hook to initialize new Realms #230

Merged
merged 2 commits into from
Feb 29, 2020
Merged

Conversation

littledan
Copy link
Member

Part of addressing #225

In HTML, this host hook would probably do something related to setting 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)

Part of addressing tc39#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 tc39#224)
@ljharb
Copy link
Member

ljharb commented Feb 28, 2020

If the intention is not to mutate the global object, could the spec state that somehow?

@littledan
Copy link
Member Author

@ljharb Good idea; done in 15f1000

@@ -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]]).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In InitializeHostDefinedRealm, we do:

Create any implementation-defined global object properties on globalObj.

I wonder if that's something that we should do here as part of HostInitializeUserRealm, or doing it here.

Copy link
Collaborator

@erights erights left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@erights erights left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (previous "Request Changes" was a finger error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants