diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-29 09:52:09 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:19 -0800 |
commit | 80ef0863098a9c6b1d559517224dbe3366c6c4f5 (patch) | |
tree | 013eb660170a78d069e29e58772e345c84c1d8b0 /emscripten.py | |
parent | 861346ff367ba31dfdce2ed8b4a6b82969902316 (diff) |
send abort and assert to asm
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py index b64e99c3..b4e289d9 100755 --- a/emscripten.py +++ b/emscripten.py @@ -283,6 +283,8 @@ def emscript(infile, settings, outfile, libraries=[]): function_tables_defs = '\n'.join([table for table in last_forwarded_json['Functions']['tables'].itervalues()]) if settings.get('ASM_JS'): + fundamentals = ['buffer', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint16Array', 'Uint32Array', 'Float32Array', 'Float64Array'] + basics = ['abort', 'assert'] # calculate exports function_tables = ['FUNCTION_TABLE_' + table for table in last_forwarded_json['Functions']['tables'].iterkeys()] exported_implemented_functions = list(exported_implemented_functions) @@ -293,10 +295,9 @@ def emscript(infile, settings, outfile, libraries=[]): # calculate globals global_vars = forwarded_json['Variables']['globals'].keys() global_funcs = ['_' + x for x in forwarded_json['Functions']['libraryFunctions'].keys()] - asm_globals = ''.join([' var ' + g + '=env.' + g + ';\n' for g in global_funcs + global_vars]) + asm_globals = ''.join([' var ' + g + '=env.' + g + ';\n' for g in basics + global_funcs + global_vars]) # sent data - basics = ['buffer', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint16Array', 'Uint32Array', 'Float32Array', 'Float64Array'] - sending = '{ ' + ', '.join([s + ': ' + s for s in basics + global_funcs + global_vars]) + ' }' + sending = '{ ' + ', '.join([s + ': ' + s for s in fundamentals + basics + global_funcs + global_vars]) + ' }' # received receiving = ';\n'.join(['var ' + s + ' = Module["' + s + '"] = asm.' + s for s in exported_implemented_functions + function_tables]) # finalize |