DefaultSimpleWasmModuleLoader class final
用于支持 Simple 扩展在 Web 上正常运行的默认加载器实现,主要职责如下:
- 在
WebAssembly.instantiateStreaming(source, importObject)模块实例化时,将所需的宿主侧能力通过importObject提供给模块用于运行期调用。 - 在模块实例化后,将模块导出的线性内存交由宿主侧,以供文件读写。
Constructors
-
DefaultSimpleWasmModuleLoader({Map<
String, Uint8List> files = const {}}) -
创建用于支持
Simple扩展在 Web 上正常运行的默认加载器。
Properties
Methods
-
createImportObject(
) → JSObject - Creates a JavaScript object providing definitions used as imported functions by the WebAssembly module.
-
instantiateModule(
Response response) → Future< WebAssemblyInstantiatedSource> -
Instantiates a module by calling
WebAssembly.instantiateStreamingwith the response and createImportObject. -
loadModule(
Response response) → Future< Instance> -
Load and instantiate a WebAssembly module from a fetch response by
providing host imports.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateFiles(
Map< String, Uint8List> apply(Map<String, Uint8List> files)) → void - 更新 Wasm 模块读写的文件。
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited