aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-28 16:59:06 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-28 17:04:51 -0700
commit5ba1a0e94fdb1f230efa34bfe5e2725ff7abef39 (patch)
treea7997d3d818b28f4908fc9e572df8dd54fc2cf98 /emscripten.py
parent1796e1798ec0664d937644308f016d65af7b216a (diff)
do not swallow exceptions in invoke_* that are not C++ exceptions or longjmp
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/emscripten.py b/emscripten.py
index 62f68fcd..6c758942 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -447,11 +447,13 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None,
''' % (sig, i, args, arg_coercions, jsret))
args = ','.join(['a' + str(i) for i in range(1, len(sig))])
args = 'index' + (',' if args else '') + args
+ # C++ exceptions are numbers, and longjmp is a string 'longjmp'
asm_setup += '''
function invoke_%s(%s) {
try {
%sModule.dynCall_%s(%s);
} catch(e) {
+ if (typeof e !== 'number' && e !== 'longjmp') throw e;
asm.setThrew(1, 0);
}
}