Created
May 8, 2015 20:54
-
-
Save lynndylanhurley/bbdd3191811db0921384 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Console-polyfill. MIT license. | |
// https://github.com/paulmillr/console-polyfill | |
// Make it safe to do console.log() always. | |
(function(con) { | |
'use strict'; | |
var prop, method; | |
var empty = {}; | |
var dummy = function() {}; | |
var properties = 'memory'.split(','); | |
var methods = ('assert,count,debug,dir,dirxml,error,exception,group,' + | |
'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' + | |
'time,timeEnd,trace,warn').split(','); | |
while (prop = properties.pop()) con[prop] = con[prop] || empty; | |
while (method = methods.pop()) con[method] = con[method] || dummy; | |
})(this.console = this.console || {}); | |
console.log.apply = function() {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment