summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-10-03 12:03:16 -0700
committerGitHub <noreply@github.com>2016-10-03 12:03:16 -0700
commit08136f5d7fd042539e69f9a330f2e55d28b738b9 (patch)
treeeb3491c174d7b7f2b4e01c2bf6eca02e0d5bb290
parent652d70cecc75fbcb4933bdc695be4d2be168f16f (diff)
downloadbinaryen-08136f5d7fd042539e69f9a330f2e55d28b738b9.tar.gz
binaryen-08136f5d7fd042539e69f9a330f2e55d28b738b9.tar.bz2
binaryen-08136f5d7fd042539e69f9a330f2e55d28b738b9.zip
Use new WebAssembly API (#724)
* use new WebAssembly.Instance/Module API * detect presence of wasm with WebAssembly object
-rw-r--r--src/js/wasm.js-post.js4
1 files 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;