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 @@ -296,7 +296,7 @@ impl<'a> Context<'a> {
296
296
297
297
let buf = self . module . emit_wasm ( ) ;
298
298
299
- let mut serialized = "const bytes = Buffer.from ([" . to_string ( ) ;
299
+ let mut serialized = "const bytes = new Uint8Array ([" . to_string ( ) ;
300
300
let ( last, bytes) = buf. split_last ( ) . unwrap ( ) ;
301
301
for byte in bytes {
302
302
serialized. push_str ( & format ! ( "{}," , byte) ) ;
@@ -306,7 +306,7 @@ impl<'a> Context<'a> {
306
306
shim. push_str ( & serialized) ;
307
307
shim. push_str (
308
308
"
309
- const wasmModule = new WebAssembly.Module(bytes);
309
+ const wasmModule = new WebAssembly.Module(bytes.buffer );
310
310
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
311
311
wasm = wasmInstance.exports;
312
312
module.exports.__wasm = wasm;
You can’t perform that action at this time.
0 commit comments