diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-28 09:02:18 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 09:55:55 -0700 |
commit | 42ad2cdbe5baa32dd1b0aea143a4e45f81e8b9b5 (patch) | |
tree | e3bc9183e04bd049d7b497c61425e44989f609fd /src/js | |
parent | 304fef1d997f1c43249996737ef7ce6deb961481 (diff) | |
download | binaryen-42ad2cdbe5baa32dd1b0aea143a4e45f81e8b9b5.tar.gz binaryen-42ad2cdbe5baa32dd1b0aea143a4e45f81e8b9b5.tar.bz2 binaryen-42ad2cdbe5baa32dd1b0aea143a4e45f81e8b9b5.zip |
import memory #684
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/wasm.js-post.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 05c648ed0..dcffb1ee8 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -183,7 +183,7 @@ function integrateWasmJS(Module) { return false; } exports = instance.exports; - mergeMemory(exports.memory); + if (exports.memory) mergeMemory(exports.memory); Module["usingWasm"] = true; @@ -274,6 +274,11 @@ function integrateWasmJS(Module) { global = fixImports(global); env = fixImports(env); + // import memory + if (!env['memory']) { + env['memory'] = providedBuffer; + } + // try the methods. each should return the exports if it succeeded var exports; |