diff --git a/lib/util.js b/lib/util.js index 08dd4b607..d720525ff 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() {