We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb8a1f1 commit 323f2faCopy full SHA for 323f2fa
crates/cli-support/src/js/mod.rs
@@ -296,7 +296,7 @@ impl<'a> Context<'a> {
296
297
let buf = self.module.emit_wasm();
298
299
- let mut serialized = "const bytes = Buffer.from([".to_string();
+ let mut serialized = "const bytes = new Uint8Array([".to_string();
300
let (last, bytes) = buf.split_last().unwrap();
301
for byte in bytes {
302
serialized.push_str(&format!("{},", byte));
@@ -306,7 +306,7 @@ impl<'a> Context<'a> {
306
shim.push_str(&serialized);
307
shim.push_str(
308
"
309
- const wasmModule = new WebAssembly.Module(bytes);
+ const wasmModule = new WebAssembly.Module(bytes.buffer);
310
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
311
wasm = wasmInstance.exports;
312
module.exports.__wasm = wasm;
0 commit comments