JsModuleLoader Class
Loads the modules imported by the scripts and the modules (HostLoadImportedModule, https://tc39.es/ecma262/#sec-HostLoadImportedModule). Set it in JsEngineOptions.ModuleLoader.
public abstract class JsModuleLoaderConstructors
| Name | Description |
|---|---|
| JsModuleLoader() |
JsModuleLoader()
protected JsModuleLoader()No documentation is available.
Methods
| Name | Description |
|---|---|
| InitializeImportMeta(JsSourceTextModule, JsObject) | Adds the properties of the import.meta object of a module (HostGetImportMetaProperties and HostFinalizeImportMeta). |
| LoadImportedModule(JsModuleLoadRequest) | Loads a module. The loader completes the request with JsModuleLoadRequest.Complete or JsModuleLoadRequest.Fail, synchronously or later (e.g. once a file is downloaded, from any thread). The same referrer and specifier must give the same module each time. |
InitializeImportMeta(JsSourceTextModule, JsObject)
JsModuleLoader.csAdds the properties of the import.meta object of a module (HostGetImportMetaProperties and HostFinalizeImportMeta).
protected internal virtual void InitializeImportMeta(JsSourceTextModule module, JsObject importMeta)Parameters
moduleJsSourceTextModuleimportMetaJsObject
LoadImportedModule(JsModuleLoadRequest)
Loads a module. The loader completes the request with JsModuleLoadRequest.Complete or JsModuleLoadRequest.Fail, synchronously or later (e.g. once a file is downloaded, from any thread). The same referrer and specifier must give the same module each time.
protected internal abstract void LoadImportedModule(JsModuleLoadRequest request)Parameters
requestJsModuleLoadRequest
Remarks
An exception thrown by this method before the request is completed fails the request: a JsException with its value, any other exception (e.g. a FileNotFoundException) with a TypeError that contains its message. A JsTerminationException, or an exception thrown after the request is completed, goes to the caller.