Skip to content

Commit 3258141

Browse files
author
Guy Bedford
committed
pr feedback
1 parent ac3a2f9 commit 3258141

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

proposals/esm-integration/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ Then by integrating with [Source Phase Imports](https://github.com/tc39/proposal
3737

3838
```js
3939
import source myModule from "./myModule.wasm");
40-
const { foo: foo1 } = await WebAssembly.instantiate(myModule, { ...imports });
41-
const { foo: foo2 } = await WebAssembly.instantiate(myModule, { ...imports });
40+
41+
const { foo: foo1 } = new WebAssembly.Instance(myModule, { ...imports1 });
4242
foo1();
43+
44+
const { foo: foo2 } = new WebAssembly.Instance(myModule, { ...imports2 });
4345
foo2();
4446
```
4547

@@ -184,9 +186,9 @@ To start using this proposal ahead of that change, create a JavaScript module wh
184186

185187
In many cases, the source phase import can replace instantiate streaming workflows, allowing for better compatibility with JS tools when it is fully supported.
186188

187-
In addition, for dynamically loaded Wasm modules, `import()` and `import.source()` can be used to obtain this in a way that integrates with the security policy (and CSP in browsers) of the module system.
189+
In addition, for dynamically loaded Wasm modules, `import()` and `import.source()` can be used to obtain these in a way that integrates with the security policy of the module system (and CSP in browsers).
188190

189-
If custom compilation options are needed or if custom streams need to be provided then the JS and Web APIs can provide a useful fallback.
191+
If custom compilation options are needed or if custom streams need to be provided then the JS and Web APIs can provide a useful fallback, where instantiateStreaming and compileStreaming are the preferred direct APIs to use.
190192

191193
### Where is the specification for this proposal?
192194

0 commit comments

Comments
 (0)