mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01:00
I find myself often using (modified) examples to test in IE and it's a pain to have to add the shims in every time. Might as well just add them in always.
16 lines
689 B
JavaScript
16 lines
689 B
JavaScript
// 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,clear,count,debug,dir,dirxml,error,exception,group,' +
|
|
'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' +
|
|
'table,time,timeEnd,timeStamp,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 || {}); // Using `this` for web workers.
|