Properly check if console exists.
This commit is contained in:
parent
1b419ba366
commit
5b9bc08d2f
@ -99,6 +99,16 @@ if [ "$DIST" = yes ]; then
|
|||||||
Module.ready = new Promise(function(resolve, reject) {
|
Module.ready = new Promise(function(resolve, reject) {
|
||||||
var Module = _Module;
|
var Module = _Module;
|
||||||
Module.onAbort = reject;
|
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() {
|
Module.onRuntimeInitialized = function() {
|
||||||
try {
|
try {
|
||||||
/* Test arbitrary wasm function */
|
/* Test arbitrary wasm function */
|
||||||
|
Loading…
Reference in New Issue
Block a user