Skip to content

Commit 7ca049e

Browse files
committed
just use importobj term directly
1 parent b7de7ee commit 7ca049e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

doc/api/esm.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,9 @@ into a new instance of `library.wasm`:
717717
```js
718718
import source libraryModule from './library.wasm';
719719

720-
const instance1 = await WebAssembly.instantiate(libraryModule, {
721-
custom: import1,
722-
});
720+
const instance1 = await WebAssembly.instantiate(libraryModule, importObject1);
723721

724-
const instance2 = await WebAssembly.instantiate(libraryModule, {
725-
custom: import2,
726-
});
722+
const instance2 = await WebAssembly.instantiate(libraryModule, importObject2);
727723
```
728724
729725
In addition to the static source phase, there is also a dynamic variant of the
@@ -732,9 +728,7 @@ source phase via the `import.source` dynamic phase import syntax:
732728
```js
733729
const dynamicLibrary = await import.source('./library.wasm');
734730

735-
const instance = await WebAssembly.instantiate(dynamicLibrary, {
736-
custom: importObj,
737-
});
731+
const instance = await WebAssembly.instantiate(dynamicLibrary, importObject);
738732
```
739733
740734
<i id="esm_experimental_top_level_await"></i>

0 commit comments

Comments
 (0)