MCPcopy
hub / github.com/webpack/webpack / instantiateWasm

Function instantiateWasm

examples/wasm-emscripten/example.js:10–15  ·  view source on GitHub ↗
(imports, receiveInstance)

Source from the content-addressed store, hash-verified

8createModule({
9 onLog: (value) => console.log("wasm logged:", value),
10 instantiateWasm(imports, receiveInstance) {
11 WebAssembly.instantiate(programWasm, imports).then((instance) =>
12 receiveInstance(instance, programWasm)
13 );
14 return {}; // signal that instantiation happens asynchronously
15 }
16}).then((Module) => {
17 console.log("run(10) =", Module.run(10));
18});

Callers

nothing calls this directly

Calls 1

receiveInstanceFunction · 0.85

Tested by

no test coverage detected