This commit is contained in:
Nicolas Lepage 2021-01-22 00:19:05 +01:00
parent 410cde261b
commit 305a51fe51
No known key found for this signature in database
GPG Key ID: B0879E35E66D8F6F

4
sw.js
View File

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