summaryrefslogtreecommitdiff
path: root/src/js/wasm.js-post.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/wasm.js-post.js')
-rw-r--r--src/js/wasm.js-post.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js
index e5e745af2..7f36776b8 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;
@@ -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.buffer, info);
mergeMemory(instance.memory);
applyMappedGlobals();