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