mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
13 lines
496 B
JavaScript
13 lines
496 B
JavaScript
|
import './go-wasm-runtime.js';
|
||
|
|
||
|
if (!WebAssembly.instantiateStreaming) { // polyfill
|
||
|
WebAssembly.instantiateStreaming = async (resp, importObject) => {
|
||
|
const source = await (await resp).arrayBuffer();
|
||
|
return await WebAssembly.instantiate(source, importObject);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
const go = new Go();
|
||
|
WebAssembly.instantiateStreaming(fetch("hello.wasm"), go.importObject).then((result) => {
|
||
|
return WebAssembly.instantiate(result.module, go.importObject);
|
||
|
}).then(instance => go.run(instance));
|