Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,17 +719,25 @@ function abort(what) {
EXITSTATUS = 1;

#if ASSERTIONS == 0
throw 'abort(' + what + '). Build with -s ASSERTIONS=1 for more info.';
what = 'abort(' + what + '). Build with -s ASSERTIONS=1 for more info.';
#else
var extra = '';
var output = 'abort(' + what + ') at ' + stackTrace() + extra;
var output = 'abort(' + what + ') at ' + stackTrace();
#if EMTERPRETIFY_ASYNC
abortDecorators.forEach(function(decorator) {
output = decorator(output, what);
});
#endif
throw output;
what = output;
#endif // ASSERTIONS

// Throw a wasm runtime error, because a JS error might be seen as a foreign
// exception, which means we'd run destructors on it. We need the error to
// simply make the program stop.
#if WASM
throw new WebAssembly.RuntimeError(what);
#else
throw what;
#endif
}

#if RELOCATABLE
Expand Down
4 changes: 3 additions & 1 deletion src/wasm2js.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ WebAssembly = {
});
}
};
}
},

RuntimeError: Error
};

// We don't need to actually download a wasm binary, mark it as present but empty.
Expand Down