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 | |
parent | 77fe34354be3cf141622d7869afafc622924d44a (diff) |
minimal C++ exceptions support
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 12 | ||||
-rw-r--r-- | src/settings.js | 2 |
2 files changed, 12 insertions, 2 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; diff --git a/src/settings.js b/src/settings.js index 7312488b..8aa9427e 100644 --- a/src/settings.js +++ b/src/settings.js @@ -30,7 +30,7 @@ USE_TYPED_ARRAYS = 0; // Try to use typed arrays for the heap // Generated code debugging options SAFE_HEAP = 0; // Check each write to the heap against a list of blocked addresses LABEL_DEBUG = 0; // Print out labels and functions as we enter them -EXCEPTION_DEBUG = 1; // Print out exceptions in emscriptened code +EXCEPTION_DEBUG = 0; // Print out exceptions in emscriptened code EXECUTION_TIMEOUT = -1; // Throw an exception after X seconds - useful to debug infinite loops // Compiler debugging options |