aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAnthony Pesch <inolen@gmail.com>2013-07-29 16:03:01 -0700
committerAnthony Pesch <inolen@gmail.com>2013-07-29 21:35:02 -0700
commit908e87a0a6fa87c03108b627ee85592922b778fa (patch)
tree734d00002b2bc9ff9b34fca2abe550700906fa3d /src/library.js
parent9987b9a039052cb84f33127e5b2c3df58f349d7c (diff)
- remove code that attempts to propogate _main's exit status through returns. we can't rely on that, the status must be signaled through an event to support both sync / async applications.
- consolidate exit functionality - moved exitRuntime to callMain
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/library.js b/src/library.js
index e650a545..895b5d55 100644
--- a/src/library.js
+++ b/src/library.js
@@ -2144,20 +2144,7 @@ LibraryManager.library = {
_exit: function(status) {
// void _exit(int status);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html
-
- function ExitStatus() {
- this.name = "ExitStatus";
- this.message = "Program terminated with exit(" + status + ")";
- this.status = status;
- Module.print('Exit Status: ' + status);
- };
- ExitStatus.prototype = new Error();
- ExitStatus.prototype.constructor = ExitStatus;
-
- exitRuntime();
- ABORT = true;
-
- throw new ExitStatus();
+ Module['exit'](status);
},
fork__deps: ['__setErrNo', '$ERRNO_CODES'],
fork: function() {
@@ -3922,8 +3909,7 @@ LibraryManager.library = {
__cxa_atexit: 'atexit',
abort: function() {
- ABORT = true;
- throw 'abort() at ' + (new Error().stack);
+ Module['abort']();
},
bsearch: function(key, base, num, size, compar) {