mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Merge pull request #833 from bas-d/emscriptenSideEffects
Override print and printErr
This commit is contained in:
@@ -99,6 +99,16 @@ if [ "$DIST" = yes ]; then
|
||||
Module.ready = new Promise(function(resolve, reject) {
|
||||
var Module = _Module;
|
||||
Module.onAbort = reject;
|
||||
Module.print = function(what) {
|
||||
if (typeof(console) !== 'undefined') {
|
||||
console.log(what);
|
||||
}
|
||||
}
|
||||
Module.printErr = function(what) {
|
||||
if (typeof(console) !== 'undefined') {
|
||||
console.warn(what);
|
||||
}
|
||||
}
|
||||
Module.onRuntimeInitialized = function() {
|
||||
try {
|
||||
/* Test arbitrary wasm function */
|
||||
|
||||
Reference in New Issue
Block a user