diff options
Diffstat (limited to 'targets/wasm_exec.js')
-rw-r--r-- | targets/wasm_exec.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js index 96ff7cfce..21bfcda18 100644 --- a/targets/wasm_exec.js +++ b/targets/wasm_exec.js @@ -276,6 +276,15 @@ mem().setUint32(nwritten_ptr, nwritten, true); return 0; }, + "proc_exit": (code) => { + if (global.process) { + // Node.js + process.exit(code); + } else { + // Can't exit in a browser. + throw 'trying to exit with code ' + code; + } + }, }, env: { // func ticks() float64 @@ -289,17 +298,6 @@ setTimeout(this._inst.exports.go_scheduler, timeout); }, - // func Exit(code int) - "syscall.Exit": (code) => { - if (global.process) { - // Node.js - process.exit(code); - } else { - // Can't exit in a browser. - throw 'trying to exit with code ' + code; - } - }, - // func finalizeRef(v ref) "syscall/js.finalizeRef": (sp) => { // Note: TinyGo does not support finalizers so this should never be |