jedisct1 / libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Other
969 stars 138 forks source link

Let nodejs process handlers be #265

Closed svvac closed 3 years ago

svvac commented 3 years ago

Building with NODEJS_CATCH_EXIT=0 and NODEJS_CATCH_REJECTION=0 tells emscripten to not add the handlers in the first place, so we do not need to compensate after the fact.

Fixes #253

svvac commented 3 years ago

This PR depends on libsodium#1025

svvac commented 3 years ago

Checking the previous build for the handlers :

$ grep -r -o -e 'unhandledRejection' -e 'uncaughtException' dist
dist/browsers-sumo/sodium.js:unhandledRejection
dist/browsers-sumo/sodium.js:unhandledRejection
dist/browsers-sumo/sodium.js:uncaughtException
dist/browsers-sumo/sodium.js:unhandledRejection
dist/browsers/sodium.js:unhandledRejection
dist/browsers/sodium.js:unhandledRejection
dist/browsers/sodium.js:uncaughtException
dist/browsers/sodium.js:unhandledRejection
dist/modules-sumo/libsodium-sumo.js:unhandledRejection
dist/modules-sumo/libsodium-sumo.js:unhandledRejection
dist/modules-sumo/libsodium-sumo.js:uncaughtException
dist/modules-sumo/libsodium-sumo.js:unhandledRejection
dist/modules/libsodium.js:unhandledRejection
dist/modules/libsodium.js:unhandledRejection
dist/modules/libsodium.js:uncaughtException
dist/modules/libsodium.js:unhandledRejection

After the changes :

$ grep -r -o -e 'unhandledRejection' -e 'uncaughtException' dist