From 7313b2bb62be47a0d778670278186738b3fd6dcb Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Thu, 30 Apr 2020 16:06:54 +0300 Subject: [PATCH] Don't fail on environments that miss console object in global scope --- .../main/resources/org/teavm/backend/javascript/runtime.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/org/teavm/backend/javascript/runtime.js b/core/src/main/resources/org/teavm/backend/javascript/runtime.js index c0efb58e3..c925e1d15 100644 --- a/core/src/main/resources/org/teavm/backend/javascript/runtime.js +++ b/core/src/main/resources/org/teavm/backend/javascript/runtime.js @@ -483,10 +483,10 @@ function $rt_createOutputFunction(printFunction) { var $rt_putStdout = typeof $rt_putStdoutCustom === "function" ? $rt_putStdoutCustom - : console ? $rt_createOutputFunction(function(msg) { console.info(msg); }) : function() {}; + : typeof console === "object" ? $rt_createOutputFunction(function(msg) { console.info(msg); }) : function() {}; var $rt_putStderr = typeof $rt_putStderrCustom === "function" ? $rt_putStderrCustom - : console ? $rt_createOutputFunction(function(msg) { console.error(msg); }) : function() {}; + : typeof console === "object" ? $rt_createOutputFunction(function(msg) { console.error(msg); }) : function() {}; var $rt_packageData = null; function $rt_packages(data) {