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

Global code vs eval code #24

Open
erights opened this issue Apr 30, 2016 · 0 comments
Open

Global code vs eval code #24

erights opened this issue Apr 30, 2016 · 0 comments

Comments

@erights
Copy link
Collaborator

erights commented Apr 30, 2016

The frozen realm spec provides only the per-realm evaluators eval and Function. An immutable root realm also provides these as well as the unnamed intrinsics GeneratorFunction, AsyncFunction, AsyncGeneratorFunction, ... . The *Function evaluators do not concern us here. The eval function evaluates code as "eval code". The ECMAScript spec also provides for code to be evaluated as "global code" but it provides no standard API to do so. Only hosts provide ways to evaluate code as global code, and only in host-specific ways. In the browser, the contents of script tags are evaluated approximately as global code.

Without an evaluator that evaluates code as global code, one cannot easily build on frozen realms a good emulation of these host environments. This issue should probably be addressed by the underlying Realms API proposal and then used by frozen realms. But either way, frozen realms need some way to do this.

See https://github.com/FUDCo/proposal-frozen-realms/wiki/Differences-between-SES,-SES5,-and-ES5#top-level-declarations

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

No branches or pull requests

1 participant