diff --git a/.gitignore b/.gitignore index 39b08f63..8f21d48f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.bc -*.cmake *.dSYM *.done *.final diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh index 093fe17b..62a4b794 100755 --- a/dist-build/emscripten.sh +++ b/dist-build/emscripten.sh @@ -108,12 +108,16 @@ if [ "$DIST" = yes ]; then reject(err); } }; + Module.useBackupModule = function () { + var Module = _Module; + Module.onAbort = undefined; + Module.onRuntimeInitialized = undefined; + Module.useBackupModule = undefined; + $(cat "${PREFIX}/lib/libsodium.asm.tmp.js" | sed 's|use asm||g') + }; $(cat "${PREFIX}/lib/libsodium.wasm.tmp.js") }).catch(function () { - var Module = _Module; - Module.onAbort = undefined; - Module.onRuntimeInitialized = undefined; - $(cat "${PREFIX}/lib/libsodium.asm.tmp.js" | sed 's|use asm||g') + _Module.useBackupModule(); }); EOM