diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-09 13:18:22 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-09 13:18:22 -0700 |
commit | cf0d875a089916b63d051b2e36d7cc00510e0c84 (patch) | |
tree | 800d1cf74bfc4354e686ae5597dd5046732eb32b /src/postamble.js | |
parent | 1d6d0572192981def4b7d4ec5d25285bb4d82183 (diff) | |
parent | 23d3488895071f1b8f71f45509ee36f40662cedd (diff) |
Merge pull request #1578 from inolen/browser_exception
gracefully handle ExitStatus exception in async main loops
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/postamble.js b/src/postamble.js index d3212767..94b60288 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -128,7 +128,15 @@ function exit(status) { // exit the runtime exitRuntime(); - + + // TODO We should handle this differently based on environment. + // In the browser, the best we can do is throw an exception + // to halt execution, but in node we could process.exit and + // I'd imagine SM shell would have something equivalent. + // This would let us set a proper exit status (which + // would be great for checking test exit statuses). + // https://github.com/kripken/emscripten/issues/1371 + // throw an exception to halt the current execution throw new ExitStatus(status); } |