diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-11 20:14:19 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-11 20:14:19 -0700 |
commit | 5ba4497c3b1751a9f212e0fe0fe1d10151fab209 (patch) | |
tree | f5b901c5dc18bfd105782fcf2dfaad87b6ffb4a2 /emscripten.py | |
parent | c259c465431a8301c1b0f4e29370c70a9b3ccc03 (diff) |
implement contents of invoke_*
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py index e0e62931..8d46b888 100755 --- a/emscripten.py +++ b/emscripten.py @@ -413,14 +413,16 @@ 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)) + args = ','.join(['a' + str(i) for i in range(1, len(sig))]) asm_setup += ''' function invoke_%s(%s) { try { + %sModule.dynCall_%s(%s); } catch(e) { Module.setThrew(1); } } -''' % (sig, ','.join(['a' + str(i) for i in range(1, len(sig))])) +''' % (sig, args, 'return ' if sig[0] != 'v' else '', sig, args) basic_funcs.append('invoke_%s' % sig) # calculate exports |