diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-29 09:47:44 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:19 -0800 |
commit | 861346ff367ba31dfdce2ed8b4a6b82969902316 (patch) | |
tree | ee9fd45b0da8e316d0df13cf0503c695c1b86035 /emscripten.py | |
parent | 9c983423f5dabf81cf4cb552e0211b8938ed3c54 (diff) |
global vars in asm.js module
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/emscripten.py b/emscripten.py index e63defe0..b64e99c3 100755 --- a/emscripten.py +++ b/emscripten.py @@ -293,10 +293,10 @@ 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]) + asm_globals = ''.join([' var ' + g + '=env.' + g + ';\n' for g in 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]) + ' }' + sending = '{ ' + ', '.join([s + ': ' + s for s in basics + global_funcs + global_vars]) + ' }' # received receiving = ';\n'.join(['var ' + s + ' = Module["' + s + '"] = asm.' + s for s in exported_implemented_functions + function_tables]) # finalize |