legacy-compat.js
 1  // sigh... life is hard
 2  if (!global.console) {
 3      console = {}
 4  }
 5  
 6  var fns = ['log', 'error', 'trace'];
 7  for (var i=0 ; i<fns.length ; ++i) {
 8      var fn = fns[i];
 9      if (!console[fn]) {
10          console[fn] = function() {};
11      }
12  }
13  
14  if (!Array.isArray) {
15      Array.isArray = function(arr) {
16          return Object.prototype.toString.call(arr) === '[object Array]';
17      }
18  }