Bug 1877792 - Part 9: Add module type to ModuleLoaderBase::{CreateStaticImport,CreateDynamicImport} r=spidermonkey-reviewers,dom-worker-reviewers,dom-core,asuth,jonco,mccr8
This patch adds a module type parameter to
`ModuleLoaderBase::{CreateStaticImport,CreateDynamicImport},` and gets rid of a
bunch of hard-coded `JS::ModuleType::JavaScript.` However, the module type is
still hard-coded when we call `CreateDynamicImport` and `CreateStaticImport`.
Differential Revision: https://phabricator.services.mozilla.com/D218556
This commit is contained in:
@@ -296,12 +296,13 @@ class ModuleLoaderBase : public nsISupports {
|
||||
private:
|
||||
// Create a module load request for a static module import.
|
||||
virtual already_AddRefed<ModuleLoadRequest> CreateStaticImport(
|
||||
nsIURI* aURI, ModuleLoadRequest* aParent) = 0;
|
||||
nsIURI* aURI, JS::ModuleType aModuleType, ModuleLoadRequest* aParent) = 0;
|
||||
|
||||
// Called by HostImportModuleDynamically hook.
|
||||
virtual already_AddRefed<ModuleLoadRequest> CreateDynamicImport(
|
||||
JSContext* aCx, nsIURI* aURI, LoadedScript* aMaybeActiveScript,
|
||||
JS::Handle<JSString*> aSpecifier, JS::Handle<JSObject*> aPromise) = 0;
|
||||
JSContext* aCx, nsIURI* aURI, JS::ModuleType aModuleType,
|
||||
LoadedScript* aMaybeActiveScript, JS::Handle<JSString*> aSpecifier,
|
||||
JS::Handle<JSObject*> aPromise) = 0;
|
||||
|
||||
virtual bool IsDynamicImportSupported() { return true; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user