diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-11 20:03:13 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-11 20:03:13 -0700 |
commit | c259c465431a8301c1b0f4e29370c70a9b3ccc03 (patch) | |
tree | 583892bf466a7b9becde03ac13a422fbeb360491 /emscripten.py | |
parent | f97347ec11f1f788148d1fac7c37afbcaa5b365f (diff) |
autogenerate invoke_* functions for asm
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/emscripten.py b/emscripten.py index dbc7b551..e0e62931 100755 --- a/emscripten.py +++ b/emscripten.py @@ -413,6 +413,15 @@ var i64Math_modulo = function(a, b, c, d, e) { i64Math.modulo(a, b, c, d, e) }; %s; } ''' % (sig, ',' if len(sig) > 1 else '', args, arg_coercions, ret)) + asm_setup += ''' +function invoke_%s(%s) { + try { + } catch(e) { + Module.setThrew(1); + } +} +''' % (sig, ','.join(['a' + str(i) for i in range(1, len(sig))])) + basic_funcs.append('invoke_%s' % sig) # calculate exports exported_implemented_functions = list(exported_implemented_functions) |