mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-28 17:04:34 +00:00
Merge pull request #5759 from Creativty/fix_wasm_undefined_this_mem
Fix #5225 wasm odin.js undefined this.mem
This commit is contained in:
@@ -1937,7 +1937,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory) {
|
||||
if (buf_len > 0 && buf_ptr) {
|
||||
let n = Math.min(buf_len, str.length);
|
||||
str = str.substring(0, n);
|
||||
this.mem.loadBytes(buf_ptr, buf_len).set(new TextEncoder().encode(str))
|
||||
wasmMemoryInterface.loadBytes(buf_ptr, buf_len).set(new TextEncoder().encode(str))
|
||||
return n;
|
||||
}
|
||||
}
|
||||
@@ -2001,7 +2001,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory) {
|
||||
if (buf_len > 0 && buf_ptr) {
|
||||
let n = Math.min(buf_len, str.length);
|
||||
str = str.substring(0, n);
|
||||
this.mem.loadBytes(buf_ptr, buf_len).set(new TextEncoder().encode(str))
|
||||
wasmMemoryInterface.loadBytes(buf_ptr, buf_len).set(new TextEncoder().encode(str))
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user