wasi.getImportObject()


返回一个可以传递给 WebAssembly.instantiate() 的导入对象,如果除了 WASI 提供的之外不需要其他 WASM 导入。

【Return an import object that can be passed to WebAssembly.instantiate() if no other WASM imports are needed beyond those provided by WASI.】

如果在构造函数中传入版本 unstable,它将返回:

【If version unstable was passed into the constructor it will return:】

{ wasi_unstable: wasi.wasiImport } 

如果在构造函数中传入了版本 preview1 或未指定版本,它将返回:

【If version preview1 was passed into the constructor or no version was specified it will return:】

{ wasi_snapshot_preview1: wasi.wasiImport }