Skip to content

Instantly share code, notes, and snippets.

@gasp
Created October 31, 2013 21:44
Show Gist options
  • Save gasp/7257730 to your computer and use it in GitHub Desktop.
Save gasp/7257730 to your computer and use it in GitHub Desktop.
console polyfill
(function (c) {
'use strict';
var prop, method,
empty = {},
dummy = function() {},
properties = 'memory'.split(','),
methods = ('assert,clear,constructor,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,'
+ 'info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn').split(',');
while (prop = properties.pop()) c[prop] = c[prop] || empty;
while (method = methods.pop()) c[method] = c[method] || dummy;
})(window.console = window.console || {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment