diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-20 15:45:48 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-20 15:45:48 -0700 |
commit | 187d2517eebb3d92921f9183609f0aa681492f37 (patch) | |
tree | 9d8542e4f3c06697e12f2934f2cb4e81abeadb7a /src/postamble.js | |
parent | 6159c4f1565a180999563dc70092f2db2e0b6562 (diff) |
remove CATCH_EXIT_CODE and make it the default behavior
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/postamble.js b/src/postamble.js index 00205abc..9ee93673 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -23,18 +23,19 @@ 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 { + 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 +122,7 @@ if (Module['noInitialRun']) { } if (shouldRunNow) { - var ret = run(); -#if CATCH_EXIT_CODE - Module.print('Exit Status: ' + ret); -#endif + run(); } // {{POST_RUN_ADDITIONS}} |