[WIP] JavaScript Realm proposal integration #6137
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(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.
(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 )