Skip to content

Commit

Permalink
[WIP] JavaScript Realm proposal integration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
littledan authored and Dan Ehrenberg committed Jul 8, 2021
1 parent 968ae81 commit 5450b14
Showing 1 changed file with 294 additions and 87 deletions.
Loading

0 comments on commit 5450b14

Please sign in to comment.