aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaytan <laytanlaats@hotmail.com>2025-10-23 09:48:09 +0200
committerGitHub <noreply@github.com>2025-10-23 09:48:09 +0200
commit5511108e412516cf10820d040117eb8b9eb91a87 (patch)
tree9f50d526c4a36e2a6a47e39e699722c23cb3bc24
parent7c2101ea3d0f2dcc0eee433e02c278f9ace45ff8 (diff)
parente724b23aace46f09216588cba9ea0738c5f4b773 (diff)
Merge pull request #5844 from cstrachan88/master
Fix #5843
-rw-r--r--core/sys/wasm/js/odin.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/sys/wasm/js/odin.js b/core/sys/wasm/js/odin.js
index f4f73a42a..43a6b002a 100644
--- a/core/sys/wasm/js/odin.js
+++ b/core/sys/wasm/js/odin.js
@@ -2112,7 +2112,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
wasmMemoryInterface.setMemory(exports.memory);
}
- exports._start();
+ if (exports._start) {
+ exports._start();
+ }
// Define a `@export step :: proc(delta_time: f64) -> (keep_going: bool) {`
// in your app and it will get called every frame.
@@ -2130,7 +2132,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
prevTimeStamp = currTimeStamp;
if (!exports.step(dt, odin_ctx)) {
- exports._end();
+ if (exports._end) {
+ exports._end();
+ }
return;
}
@@ -2139,7 +2143,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
window.requestAnimationFrame(step);
} else {
- exports._end();
+ if (exports._end) {
+ exports._end();
+ }
}
return;