diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-11-20 15:19:01 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-11-20 15:19:01 -0800 |
commit | aa7790adb7357136620b4a4f4924b3ab5dccc75d (patch) | |
tree | 36d31a878320b62eadd64742368a25e045e005d3 /src/library.js | |
parent | 77fe34354be3cf141622d7869afafc622924d44a (diff) |
minimal C++ exceptions support
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js index a1a3ac2f..3e337c9d 100644 --- a/src/library.js +++ b/src/library.js @@ -166,12 +166,22 @@ var Library = { return 1; }, + // Exceptions - minimal support, only (...) for now (no actual exception objects can be caught) + __cxa_allocate_exception: function(size) { + return _malloc(size); // warning: leaked + }, + __cxa_throw: function(ptr, data, dunno) { + throw ptr; + }, llvm_eh_exception: function() { return 'code-generated exception: ' + (new Error().stack); }, - llvm_eh_selector: function(exception, personality, num) { }, + __cxa_begin_catch: function(ptr) { + }, + __cxa_end_catch: function(ptr) { + }, __cxa_call_unexpected: function(exception) { ABORT = true; |