We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61b4cca commit 8824341Copy full SHA for 8824341
crates/cli-support/src/js/mod.rs
@@ -310,7 +310,7 @@ impl<'a> Context<'a> {
310
311
let buf = self.module.emit_wasm();
312
313
- let mut serialized = "const bytes = Buffer.from([".to_string();
+ let mut serialized = "const bytes = new Uint8Array([".to_string();
314
let (last, bytes) = buf.split_last().unwrap();
315
for byte in bytes {
316
serialized.push_str(&format!("{},", byte));
@@ -320,7 +320,7 @@ impl<'a> Context<'a> {
320
shim.push_str(&serialized);
321
shim.push_str(
322
"
323
- const wasmModule = new WebAssembly.Module(bytes);
+ const wasmModule = new WebAssembly.Module(bytes.buffer);
324
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
325
wasm = wasmInstance.exports;
326
module.exports.__wasm = wasm;
0 commit comments