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
+27
View File
@@ -0,0 +1,27 @@
package main
import (
"os"
"time"
)
func main() {
println("wasmexit test:", os.Args[1])
switch os.Args[1] {
case "normal":
return
case "exit-0":
os.Exit(0)
case "exit-0-sleep":
time.Sleep(time.Millisecond)
println("slept")
os.Exit(0)
case "exit-1":
os.Exit(1)
case "exit-1-sleep":
time.Sleep(time.Millisecond)
println("slept")
os.Exit(1)
}
println("unknown wasmexit test")
}