From 08136f5d7fd042539e69f9a330f2e55d28b738b9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 3 Oct 2016 12:03:16 -0700 Subject: Use new WebAssembly API (#724) * use new WebAssembly.Instance/Module API * detect presence of wasm with WebAssembly object --- src/js/wasm.js-post.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 1c5e6b0b1..5fa783230 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -164,7 +164,7 @@ function integrateWasmJS(Module) { } function doNativeWasm(global, env, providedBuffer) { - if (typeof Wasm !== 'object') { + if (typeof WebAssembly !== 'object') { Module['printErr']('no native wasm support detected'); return false; } @@ -177,7 +177,7 @@ function integrateWasmJS(Module) { info['env'] = env; var instance; try { - instance = Wasm['instantiateModule'](getBinary(), info); + instance = new WebAssembly.Instance(new WebAssembly.Module(getBinary()), info) } catch (e) { Module['printErr']('failed to compile wasm module: ' + e); return false; -- cgit v1.2.3