From d01db78204c06c452c7d9068577a40528d3c9699 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 24 Jan 2019 09:43:31 +0000 Subject: [PATCH 1/2] Removed dependency on global window object. --- lib/util.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 08dd4b607..288b889d7 100644 --- a/lib/util.js +++ b/lib/util.js @@ -199,7 +199,13 @@ util.getLink = function(obj, linkName, altName) { }; util.getNativeConsole = function() { - return window.console; + if (typeof window !== "undefined") { + return window.console; + } else if (typeof console !== "undefined") { + return console; + } else { + return undefined; + } }; util.getConsole = function() { From 46858332100fd6da018acb075b710bb355e73b38 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 24 Jan 2019 09:56:35 +0000 Subject: [PATCH 2/2] Fixed quotes for CI --- lib/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index 288b889d7..d720525ff 100644 --- a/lib/util.js +++ b/lib/util.js @@ -199,9 +199,9 @@ util.getLink = function(obj, linkName, altName) { }; util.getNativeConsole = function() { - if (typeof window !== "undefined") { + if (typeof window !== 'undefined') { return window.console; - } else if (typeof console !== "undefined") { + } else if (typeof console !== 'undefined') { return console; } else { return undefined;