diff options
Diffstat (limited to 'scripts/wasm2js.js')
-rw-r--r-- | scripts/wasm2js.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/wasm2js.js b/scripts/wasm2js.js index 4a16184d0..d76e37280 100644 --- a/scripts/wasm2js.js +++ b/scripts/wasm2js.js @@ -64,9 +64,9 @@ var WebAssembly = { }; var atob = decodeBase64; // Additional imports - asmLibraryArg['__tempMemory__'] = 0; // risky! + info['env']['__tempMemory__'] = 0; // risky! // This will be replaced by the actual wasm2js code. - var exports = instantiate(asmLibraryArg, wasmMemory); + var exports = instantiate(info, wasmMemory); return { 'exports': exports }; @@ -85,7 +85,7 @@ var WebAssembly = { var tempRet0 = 0; -var asmLibraryArg = { +var env = { log_i32: function(x) { console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ']'); }, @@ -113,7 +113,7 @@ var asmLibraryArg = { }, get_i64: function(loc, index, low, high) { console.log('get_i64 ' + [loc, index, low, high]); - asmLibraryArg['setTempRet0'](high); + env['setTempRet0'](high); return low; }, get_f32: function(loc, index, value) { @@ -130,7 +130,7 @@ var asmLibraryArg = { }, set_i64: function(loc, index, low, high) { console.log('set_i64 ' + [loc, index, low, high]); - asmLibraryArg['setTempRet0'](high); + env['setTempRet0'](high); return low; }, set_f32: function(loc, index, value) { @@ -151,7 +151,7 @@ var asmLibraryArg = { }, load_val_i64: function(loc, low, high) { console.log('load_val_i64 ' + [loc, low, high]); - asmLibraryArg['setTempRet0'](high); + env['setTempRet0'](high); return low; }, load_val_f32: function(loc, value) { @@ -172,7 +172,7 @@ var asmLibraryArg = { }, store_val_i64: function(loc, low, high) { console.log('store_val_i64 ' + [loc, low, high]); - asmLibraryArg['setTempRet0'](high); + env['setTempRet0'](high); return low; }, store_val_f32: function(loc, value) { |