aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library.js4
-rw-r--r--src/postamble.js2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index e7c53be9..9ad35fab 100644
--- a/src/library.js
+++ b/src/library.js
@@ -34,6 +34,10 @@ var Library = {
},
__cxa_atexit: 'atexit',
+ abort: function(code) {
+ throw 'ABORT: ' + code + ', at ' + (new Error().stack);
+ },
+
// string.h
strlen: function(p) {
diff --git a/src/postamble.js b/src/postamble.js
index f47f3d42..a185b306 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -30,7 +30,7 @@ function run(args) {
try {
run(this.arguments ? arguments : []);
} catch (e) {
- print("Fatal exception: " + e.stack);
+ print("Fatal exception: " + e);
throw e;
}