diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-22 16:22:16 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-22 16:22:16 -0700 |
commit | a8e4801c7d38033fff760ea26a4579aa324e303e (patch) | |
tree | 01c8c9862f7a6e1b60569aa9be97fd2751be8709 /src/postamble.js | |
parent | 669c786e3554b280e31dcb7bd92931482547dae0 (diff) | |
parent | f99012f271c056ddc171f6a4ec011ad31ad936cd (diff) |
Merge branch 'incoming'
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/postamble.js b/src/postamble.js index 00205abc..dd4f4f37 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -23,18 +23,21 @@ Module.callMain = function callMain(args) { var ret; -#if CATCH_EXIT_CODE var initialStackTop = STACKTOP; try { ret = Module['_main'](argc, argv, 0); } - catch(e) { if (e.name == "ExitStatus") return e.status; throw e; } - finally { + catch(e) { + if (e.name == 'ExitStatus') { + return e.status; + } else if (e == 'SimulateInfiniteLoop') { + Module['noExitRuntime'] = true; + } else { + throw e; + } + } finally { STACKTOP = initialStackTop; } -#else - ret = Module['_main'](argc, argv, 0); -#endif #if BENCHMARK Module.realPrint('main() took ' + (Date.now() - start) + ' milliseconds'); @@ -121,10 +124,7 @@ if (Module['noInitialRun']) { } if (shouldRunNow) { - var ret = run(); -#if CATCH_EXIT_CODE - Module.print('Exit Status: ' + ret); -#endif + run(); } // {{POST_RUN_ADDITIONS}} |