1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 12:36:01 -07:00

Check if console is null or undefined.

This commit is contained in:
bas-d 2019-05-12 12:41:55 +02:00
parent e1176fe2bb
commit 646c0cfd46

View File

@ -100,10 +100,14 @@ if [ "$DIST" = yes ]; then
var Module = _Module;
Module.onAbort = reject;
Module.print = function(what) {
console.log(what);
if (console != null) {
console.log(what);
}
}
Module.printErr = function(what) {
console.warn(what);
if (console != null) {
console.warn(what);
}
}
Module.onRuntimeInitialized = function() {
try {