From cbbdaf782716e7a66fc95513e56eac58f2db1dc3 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 24 Mar 2016 16:12:38 -0700 Subject: if Module.asm is already set, use that --- src/js/wasm.js-post.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/js') 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'); -- cgit v1.2.3