This commit is contained in:
Nicolas Lepage 2021-01-22 00:10:05 +01:00
parent ee59e565e8
commit cea18c5f76
No known key found for this signature in database
GPG Key ID: B0879E35E66D8F6F

3
sw.js
View File

@ -27,9 +27,8 @@ function registerWasmHTTPListener(wasm, base, args = []) {
const go = new Go()
go.env = { WASMHTTP_HANDLER_ID: handlerId, WASMHTTP_PATH: path }
go.argv = [wasm, ...args]
const { instance } = await WebAssembly.instantiateStreaming(wasmPromise, go.importObject)
// FIXME await ? catch ?
go.run(instance)
WebAssembly.instantiateStreaming(wasmPromise, go.importObject).then(({ instance }) => go.run(instance))
e.respondWith(handlerPromise.then(handler => handler(e.request)))
})