Bug 1881564 - Initialize module loader also for ServiceWorker to allow ChromeUtils.importESModule in DevTools ServiceWorker debugger global. r=yulia
Dynamic import is prevented by IsDynamicImportSupported, and now it now throws TypeError instead of Error, and related wpt passes with it. Differential Revision: https://phabricator.services.mozilla.com/D202494
This commit is contained in:
@@ -251,6 +251,8 @@ class ModuleLoaderBase : public nsISupports {
|
||||
JSContext* aCx, nsIURI* aURI, LoadedScript* aMaybeActiveScript,
|
||||
JS::Handle<JSString*> aSpecifier, JS::Handle<JSObject*> aPromise) = 0;
|
||||
|
||||
virtual bool IsDynamicImportSupported() { return true; }
|
||||
|
||||
// Called when dynamic import started successfully.
|
||||
virtual void OnDynamicImportStarted(ModuleLoadRequest* aRequest) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user