-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
initial module checkin #297
Conversation
Please note that the WHATWG Loader and the Node loader have intrinsic differences and the Loader will likely require host environment setup outside of the VM. These problems are explained in nodejs/node-eps#3 which holds the Node a companion proposal to the WHATWG proposal about how Node needs to instrument things. |
reference to another potential change in the spec (at JS level, not Loader) : tc39/ecma262#368 |
{ | ||
LoadScriptFlag_None = 0x0, | ||
LoadScriptFlag_Expression = 0x1, // the script returns a value. | ||
LoadScriptFlag_disableDeferredParse = 0x2, // do not defer-parse the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to make casing consistent between these flags?
Big change looks good to me! |
Does this change contain the compile-time API that takes an import symbol and returns the module index and symbol index? |
@pleath no that's part of ModuleDeclarationInitialization and it is not implemented yet. |
Okay. Thanks. What's here LGTM. |
Merge pull request #297 from pr/yongqu/module This is initial runtime support for module ( parser change at #293). This PR contain the basic support for host integration, and it can act as basic bootstrap to enable edge support later. Current es6 module spec does not clarify the dependency module loading sequence, and module loader spec is not finalized yet. At this time, we will allow browser host to start from scripttype='module' tag, and allow host to asynchronously fetch child module sources. This is in effect adding a small state machine between ParseModule and ModuleDeclarationInstantiation. Once all modules are parsed and initialized, the script engine notifies the host, and ModuleEvaluation of top level module will start asynchronously, initiated from the host. There are still a lot of unimplemented features, including experimental JSRT APIs that match execution model, namespace object and ResolveExports, error handling etc. Also this change is developed in parallel to the parser change it will be integrated with the parser part later.
#293).
This PR contain the basic support for host integration, and it can act as basic bootstrap to
enable edge support later.
Current es6 module spec does not clarify the dependency module loading sequence, and module
loader spec is not finalized yet. At this time, we will allow browser host to start from scripttype='module'
tag, and allow host to asynchronously fetch child module sources. This is in effect adding a small state
machine between ParseModule and ModuleDeclarationInstantiation. Once all modules are parsed and
initialized, the script engine notifies the host, and ModuleEvaluation of top level module will start
asynchronously, initiated from the host.
There are still a lot of unimplemented features, including experimental JSRT APIs that match
execution model, namespace object and ResolveExports, error handling etc. Also this change is
developed in parallel to the parser change it will be integrated with the parser part later.