|
38
|
1 |
// Avoid `console` errors in browsers that lack a console. |
|
|
2 |
(function() { |
|
|
3 |
var method; |
|
|
4 |
var noop = function noop() {}; |
|
|
5 |
var methods = [ |
|
|
6 |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', |
|
|
7 |
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', |
|
|
8 |
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', |
|
|
9 |
'timeStamp', 'trace', 'warn' |
|
|
10 |
]; |
|
|
11 |
var length = methods.length; |
|
|
12 |
var console = (window.console = window.console || {}); |
|
|
13 |
|
|
|
14 |
while (length--) { |
|
|
15 |
method = methods[length]; |
|
|
16 |
|
|
|
17 |
// Only stub undefined methods. |
|
|
18 |
if (!console[method]) { |
|
|
19 |
console[method] = noop; |
|
|
20 |
} |
|
|
21 |
} |
|
|
22 |
}()); |
|
|
23 |
|
|
|
24 |
// Place any jQuery/helper plugins in here. |