Permalink
Browse files

Add code from HTML5 Boilerplate to prevent JS errors when console is …

…unavailable.
  • Loading branch information...
1 parent 72f063d commit 4e896d34ec90c2b5216f6be8e37b1e41fbae2927 @akavlie committed Nov 9, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 js/util.js
View
@@ -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
// =========

0 comments on commit 4e896d3

Please sign in to comment.