console-polyfill.js 639 B

123456789101112131415
  1. // Console-polyfill. MIT license.
  2. // https://github.com/paulmillr/console-polyfill
  3. // Make it safe to do console.log() always.
  4. (function (con) {
  5. 'use strict';
  6. var prop, method;
  7. var empty = {};
  8. var dummy = function() {};
  9. var properties = 'memory'.split(',');
  10. var methods = ('assert,count,debug,dir,dirxml,error,exception,group,' +
  11. 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' +
  12. 'time,timeEnd,trace,warn').split(',');
  13. while (prop = properties.pop()) con[prop] = con[prop] || empty;
  14. while (method = methods.pop()) con[method] = con[method] || dummy;
  15. })(window.console = window.console || {});