Support in other browsers: - Edge: public support; not implemented - Firefox: public support; not implemented - Safari: implemented and shipping in Safari Tech Preview
bugdro… via monorail
unread,
Aug 7, 2017, 6:21:06 AM8/7/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
This CL introduces a new flag "--enable-module-scripts-dynamic-import", which will enable: - import() syntax support in V8, and - dynamic import() implementation in Blink. Future CLs which implement these features will be gated through this command-line flag.
This info can be encoded into v8::Local<v8::PrimitiveArray> and will be attached to v8::ScriptOrigin in future CLs. Dynamic import resolver will extract this from the ScriptOrigin of the referencing script in its implementation of "HostImportModuleDynamically" algorithm.
[ES6 modules] Update V8ScriptRunner::Compile{Script,Module} to set ReferrerScriptInfo
This CL adds ReferrerScriptInfo arg to V8ScriptRunner::Compile{Script,Module}, and the method will set the ReferrerScriptInfo specified to v8::ScriptOrigin. This CL also modifies module script compilation pipeline to plumb down the ReferrerScriptInfo up to V8ScriptRunner::CompileModule.
V8ScriptRunner::CompileScript will be modified in future CLs.
[ES6 modules] Enable V8 dynamic import syntax when the feature is enabled
This CL enables "--harmony-dynamic-import" when kModuleScriptsDynamicImport feature is enabled, and plumbs the V8 callback for HostImportModuleDynamically to blink::Modulator.
Make ScriptReferrerInfo non-optional for 2 overloads of V8ScriptRunner::CompileScript
ScriptReferrerInfo should be passed explicitly for all invocation of V8ScriptRunner::CompileScript. This CL partially addresses the issue by making the ScriptReferrerInfo argument non-optional for its 2 overloads.
A follow-up CL is planned to fix the last overload of the V8ScriptRunner::CompileScript.
[ES6 modules] WPT: dynamically imported modules from valid nonce should eval
This CL adds web-platform-tests that verify dynamically imported modules from {out-of-line,inline} {classic,module} script w/ a valid nonce should eval.
[ES6 modules] Implement run-a-module-script with "rethrow errors" flag
This CL updates the run-a-module-script HTML spec algorithm with its new argument "rethrow errors" flag, which is used from dynamic imports.
With this CL, ScriptModule::Evaluate takes another argument CaptureEvalErrorFlag, and allows the caller to capture the error instead of "report the error" algorithm.
[ES6 modules] Plumb V8 host callbacks to DynamicModuleResolver
This CL plumbs the V8 callback for "Runtime Semantics: HostImportModuleDynamically" to DynamicModuleResolver. With this CL, basic usage of dynamic imports should work when --enable-features=ModuleScriptsDynamicImport.
This CL adds ScriptSourceCode::{nonce_,parser_state_}, which are used to carry the corresponding <script> element's nonce attr value and whether the element was parser inserted or not.
The added nonce/parser_state is stored in V8 via ScriptReferrerInfo/V8::ScriptOrigin when compiling the script.
This CL also removes obsolete DCHECK in V8ScriptRunner::CompileScript which assumes classic scripts to be always fetch credentials mode "omit", as the corresponding spec text was removed in latest spec.
[ES6 modules] import should not crash when used inside inline event handler
Before this CL, dynamic import from non-script tag has failed DCHECK(). This CL fixes the crash and makes it refer document.URL for resolving relative URLs.