Skip to content

Commit

Permalink
Add code from HTML5 Boilerplate to prevent JS errors when console is …
Browse files Browse the repository at this point in the history
…unavailable.
  • Loading branch information
akavlie committed Nov 9, 2011
1 parent 72f063d commit 4e896d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/util.js
@@ -1,3 +1,7 @@
// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,clear,count,debug,dir,dirxml,error,exception,firebug,group,groupCollapsed,groupEnd,info,log,memoryProfile,memoryProfileEnd,profile,profileEnd,table,time,timeEnd,timeStamp,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());

// POLYFILLS
// =========

Expand Down

0 comments on commit 4e896d3

Please sign in to comment.