Browse Source

Fix #5225 wasm odin.js undefined this.mem

xenobas 1 week ago
parent
commit
3edf964b55
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/sys/wasm/js/odin.js

+ 2 - 2
core/sys/wasm/js/odin.js

@@ -1937,7 +1937,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory) {
 					if (buf_len > 0 && buf_ptr) {
 					if (buf_len > 0 && buf_ptr) {
 						let n = Math.min(buf_len, str.length);
 						let n = Math.min(buf_len, str.length);
 						str = str.substring(0, n);
 						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;
 						return n;
 					}
 					}
 				}
 				}
@@ -2001,7 +2001,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory) {
 					if (buf_len > 0 && buf_ptr) {
 					if (buf_len > 0 && buf_ptr) {
 						let n = Math.min(buf_len, str.length);
 						let n = Math.min(buf_len, str.length);
 						str = str.substring(0, n);
 						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;
 						return n;
 					}
 					}
 				}
 				}