wasm: use WASI ABI for exit function

This improves compatibility between the regular browser target
(-target=wasm) and the WASI target (-target=wasi). Specifically, it
allows running WASI tests like this:

    tinygo test -target=wasi encoding/base32
This commit is contained in:
Ayke van Laethem
2021-04-14 23:10:42 +02:00
committed by Ron Evans
parent f145663464
commit 6dd5666ed1
3 changed files with 23 additions and 11 deletions
+3
View File
@@ -19,4 +19,7 @@ func main() {
// package strings
fmt.Println("strings.IndexByte:", strings.IndexByte("asdf", 'd'))
fmt.Println("strings.Replace:", strings.Replace("An example string", " ", "-", -1))
// Exit the program normally.
os.Exit(0)
}