Skip to content

Commit

Permalink
fix: guard compileStreaming
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Aug 8, 2023
1 parent a482954 commit 6be9a22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export async function format(input, wasm_url) {
const fs = await import("node:fs");
const bytes = fs.readFileSync(wasm_url);
mod = new WebAssembly.Module(bytes);
} else if ("instantiateStreaming" in WebAssembly) {
mod = await WebAssembly.compileStreaming(fetch(wasm_url), go.importObject);
} else if ("compileStreaming" in WebAssembly) {
mod = await WebAssembly.compileStreaming(fetch(wasm_url));
} else {
const response = await fetch(wasm_url);
const bytes = await response.arrayBuffer();
Expand Down

0 comments on commit 6be9a22

Please sign in to comment.