File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
crates/cli-support/src/js Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ impl<'a> Context<'a> {
310
310
311
311
let buf = self . module . emit_wasm ( ) ;
312
312
313
- let mut serialized = "const bytes = Buffer.from ([" . to_string ( ) ;
313
+ let mut serialized = "const bytes = new Uint8Array ([" . to_string ( ) ;
314
314
let ( last, bytes) = buf. split_last ( ) . unwrap ( ) ;
315
315
for byte in bytes {
316
316
serialized. push_str ( & format ! ( "{}," , byte) ) ;
@@ -320,7 +320,7 @@ impl<'a> Context<'a> {
320
320
shim. push_str ( & serialized) ;
321
321
shim. push_str (
322
322
"
323
- const wasmModule = new WebAssembly.Module(bytes);
323
+ const wasmModule = new WebAssembly.Module(bytes.buffer );
324
324
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
325
325
wasm = wasmInstance.exports;
326
326
module.exports.__wasm = wasm;
You can’t perform that action at this time.
0 commit comments