X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fpolyfills%2Fconsole.js;fp=src%2Fpolyfills%2Fconsole.js;h=4a6f5423a482f0a641034ffa568af6e4d6a3e697;hb=3123ca57f71d145bb5bcc4a2f754d3dff3225346;hp=0000000000000000000000000000000000000000;hpb=26ee953643ccd2d32e38e6b60b20e6a01c1dc9ba;p=dygraphs.git diff --git a/src/polyfills/console.js b/src/polyfills/console.js new file mode 100644 index 0000000..4a6f542 --- /dev/null +++ b/src/polyfills/console.js @@ -0,0 +1,15 @@ +// 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,profiles,profileEnd,' + + 'show,table,time,timeEnd,timeline,timelineEnd,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.