aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-14 12:17:21 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-14 12:17:21 -0800
commitc13c1c7d4c9df0d41348ed7a23728a5155243ac1 (patch)
tree8438d75483498b48eae2e872023340a4c330285d
parenta41250b4e5c75fac33f96cd449f672360e4685bb (diff)
take into account redirects in wrappers
-rwxr-xr-xemscripten.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py
index 7514b3ca..68018f70 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -932,7 +932,10 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
if item == '0': return bad if not newline else (bad + '\n')
if item not in metadata['implementedFunctions']:
# this is imported into asm, we must wrap it
- code = item + '(' + coerced_params + ')'
+ call_ident = item
+ if call_ident in metadata['redirects']: call_ident = metadata['redirects'][call_ident]
+ if not call_ident.startswith('_') and not call_ident.startswith('Math_'): call_ident = '_' + call_ident
+ code = call_ident + '(' + coerced_params + ')'
if sig[0] != 'v':
code = 'return ' + shared.JS.make_coercion(code, sig[0], settings)
code += ';'