Skip to content

Commit

Permalink
Merge pull request maxmcd#6 from ViBiOh/patch-1
Browse files Browse the repository at this point in the history
Adding polyfill for Safari WebAssembly
  • Loading branch information
maxmcd authored Nov 15, 2018
2 parents 2b10044 + 2571d2f commit d1f5a75
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web-client/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Terminal.applyAddon(attach);
Terminal.applyAddon(fullscreen);
Terminal.applyAddon(fit);

// Polyfill for WebAssembly on Safari
if (!WebAssembly.instantiateStreaming) {
WebAssembly.instantiateStreaming = async (resp, importObject) => {
const source = await (await resp).arrayBuffer();
return await WebAssembly.instantiate(source, importObject);
};
}

const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then(
result => {
Expand Down

0 comments on commit d1f5a75

Please sign in to comment.