wasm: correctly return from run() in wasm_exec.js

Instead of hanging forever, it should return the exit code from os.Exit.
This commit is contained in:
Ayke van Laethem
2024-10-30 12:24:21 +01:00
committed by Ayke
parent 04a7baec3e
commit ceb7891986
12 changed files with 173 additions and 30 deletions
+7
View File
@@ -60,6 +60,13 @@ func syscall_Exit(code int) {
exit.Exit(code != 0)
}
func mainReturnExit() {
// WASIp2 does not use _start, instead it uses _initialize and a custom
// WASIp2-specific main function. So this should never be called in
// practice.
runtimePanic("unreachable: _start was called")
}
// TinyGo does not yet support any form of parallelism on WebAssembly, so these
// can be left empty.