Created
August 30, 2011 19:48
-
-
Save bonza-labs/1181835 to your computer and use it in GitHub Desktop.
Stub the widow.console object when not available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof window.console === "undefined") { | |
var noOpFunc = function() { }; | |
window.console = { | |
assert: noOpFunc, | |
log: noOpFunc, | |
warn: noOpFunc, | |
debug: noOpFunc, | |
info: noOpFunc, | |
time: noOpFunc, | |
timeEnd: noOpFunc, | |
profile: noOpFunc, | |
profileEnd: noOpFunc, | |
dir: noOpFunc, | |
dirXml: noOpFunc, | |
group: noOpFunc, | |
groupEnd: noOpFunc, | |
markTimeline: noOpFunc, | |
trace: noOpFunc | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment