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

[WIP] JavaScript Realm proposal integration #6137

Closed
wants to merge 1 commit into from

Conversation

littledan
Copy link
Contributor

@littledan littledan commented Nov 9, 2020

(WIP refactor of #5339)

This patch gives the TC39 JavaScript Realm proposal semantics in HTML.
Realms are given an environment settings object, which is especially
meaningful for module loading.

Realms created with the JavaScript Realm API are identified as "synthetic"
realms, whereas Realms which implement the Window or WorkerGlobalObject
interfaces are identified as "principal" realms. All synthetic realms
have an associated principal realm.

HTML/Web state and behavior which was previously keyed by realm is instead
generally keyed by principal realm, including the association with an
environment settings object, with the exception of the module map.

Each realm, both synthetic and principal realms, contain their own module
map. This is because JavaScript modules close over a global object, and
it may be useful to run a module in the context of a synthetic realm.

The Realm proposal is currently at Stage 2, and this patch should not
land until, at the earliest, the proposal is at Stage 3.

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chrome: …
    • Firefox: …
    • Safari: …

(See WHATWG Working Mode: Changes for more details.)


/browsers.html ( diff )
/browsing-the-web.html ( diff )
/dom.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/references.html ( diff )
/timers-and-user-prompts.html ( diff )
/webappapis.html ( diff )

This patch gives the TC39 JavaScript Realm proposal semantics in HTML.
Realms are given an environment settings object, which is especially
meaningful for module loading.

Realms created with the JavaScript Realm API are identified as "synthetic"
realms, whereas Realms which implement the Window or WorkerGlobalObject
interfaces are identified as "principal" realms. All synthetic realms
have an associated principal realm.

HTML/Web state and behavior which was previously keyed by realm is instead
generally keyed by principal realm, including the association with an
environment settings object, with the exception of the module map.

Each realm, both synthetic and principal realms, contain their own module
map. This is because JavaScript modules close over a global object, and
it may be useful to run a module in the context of a synthetic realm.

The Realm proposal is currently at Stage 2, and this patch should not
land until, at the earliest, the proposal is at Stage 3.
@littledan
Copy link
Contributor Author

Note that this was closed as #5339 is now updated to take this approach.

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

Successfully merging this pull request may close these issues.

1 participant