From c4ba893ba88b7560c31d6c5c7cc0b93a3ebaeab7 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 4 Mar 2016 21:37:49 -0800 Subject: use lookupImport directly --- src/js/wasm.js-post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/wasm.js-post.js') diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index e5e745af2..4848da47b 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -97,7 +97,7 @@ function integrateWasmJS(Module) { for (var name in mappedGlobals) { var global = mappedGlobals[name]; if (!global.import) continue; // non-imports are initialized to zero in the typed array anyhow, so nothing to do here - var value = wasmJS['lookupImport'](global.module, global.base); + var value = lookupImport(global.module, global.base); var address = global.address; switch (global.type) { case WasmTypes.i32: Module['HEAP32'][address >> 2] = value; break; -- cgit v1.2.3 From c5f98754c9c2938c1eaa493f8103bff11ebab628 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 4 Mar 2016 21:38:59 -0800 Subject: WASM => Wasm --- src/js/wasm.js-post.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/js/wasm.js-post.js') diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 4848da47b..539397ca6 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -108,7 +108,7 @@ function integrateWasmJS(Module) { } } - if (typeof WASM === 'object' || typeof wasmEval === 'function') { + if (typeof Wasm === 'object') { // Provide an "asm.js function" for the application, called to "link" the asm.js module. We instantiate // the wasm module at that time, and it receives imports and provides exports and so forth, the app // doesn't need to care that it is wasm and not asm. @@ -119,13 +119,7 @@ function integrateWasmJS(Module) { info['global'] = { 'Math': global.Math }; info['env'] = env; var instance; - if (typeof WASM === 'object') { - instance = WASM.instantiateModule(binary, info); - } else if (typeof wasmEval === 'function') { - instance = wasmEval(binary.buffer, info); - } else { - throw 'how to wasm?'; - } + instance = Wasm.instantiateModule(binary, info); mergeMemory(instance.memory); applyMappedGlobals(); -- cgit v1.2.3 From 2a36300d4318a0a7b7275eac4939d4badfe74877 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 4 Mar 2016 21:39:38 -0800 Subject: pass buffer to instantiateModule --- src/js/wasm.js-post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/wasm.js-post.js') diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 539397ca6..7f36776b8 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -119,7 +119,7 @@ function integrateWasmJS(Module) { info['global'] = { 'Math': global.Math }; info['env'] = env; var instance; - instance = Wasm.instantiateModule(binary, info); + instance = Wasm.instantiateModule(binary.buffer, info); mergeMemory(instance.memory); applyMappedGlobals(); -- cgit v1.2.3