diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-24 16:12:38 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-24 16:18:37 -0700 |
commit | cbbdaf782716e7a66fc95513e56eac58f2db1dc3 (patch) | |
tree | 4bd29166877d8cfd89775c64f0adc4de587e0811 | |
parent | 1ad605a7e2f413d90213ae50824af20b8cac2397 (diff) | |
download | binaryen-cbbdaf782716e7a66fc95513e56eac58f2db1dc3.tar.gz binaryen-cbbdaf782716e7a66fc95513e56eac58f2db1dc3.tar.bz2 binaryen-cbbdaf782716e7a66fc95513e56eac58f2db1dc3.zip |
if Module.asm is already set, use that
-rw-r--r-- | src/js/wasm.js-post.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 5d3988432..9851fc777 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -154,7 +154,10 @@ function integrateWasmJS(Module) { // do-method functions function doJustAsm() { - eval(Module['read'](asmjsCodeFile)); + if (typeof Module['asm'] !== 'function') { + // you can load the .asm.js file before this, to avoid this sync xhr and eval + eval(Module['read'](asmjsCodeFile)); + } if (typeof Module['asm'] !== 'function') { // evalling the asm.js file should have set this Module['printErr']('asm evalling did not set the module properly'); |