Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Investigate implementing ApplicationDomain as ES6 Realms #1078

Closed
tschneidereit opened this issue Jan 21, 2014 · 1 comment
Closed

Investigate implementing ApplicationDomain as ES6 Realms #1078

tschneidereit opened this issue Jan 21, 2014 · 1 comment

Comments

@tschneidereit
Copy link
Contributor

The latest ES6 draft contains specification text for Realm objects: globals that get a new set of bindings for all builtins, etc.

These are used to implement module loading, which can be done in a way that the loaded module is entirely separate from existing state. Code evaluated in such a realm uses the realm's global as its lexical this.

By passing options to the Realm ctor, it's possible to customize this and provide your own implementations of (direct and indirect) eval. Plus, you then have access to realm.global, and can add or delete whatever builtins you want.

See a discussion of realms in the nov 21 meeting notes. (Not directly linkable, search for "Realms: Globals, Intrinsics, Eval Hooks")

@ghost ghost assigned mbebenita Jan 21, 2014
@cpeterso cpeterso added this to the M2 Off Main Thread Shumway milestone Mar 7, 2014
@tschneidereit
Copy link
Contributor Author

Realms haven't made it into ES6 as a content-visible API, after all. We might use sandboxes in the extension and iframes in other embeddings, but this particular issue isn't going anywhere.

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

No branches or pull requests

3 participants