|
1 | | -;(function() { |
2 | 1 |
|
3 | | -var console = {} |
4 | | - , files = __TESTS__; |
| 2 | +;(function() { |
| 3 | + var console = {}, |
| 4 | + files = __TESTS__; // eslint-disable-line no-undef |
5 | 5 |
|
6 | | -console.log = function(text) { |
7 | | - var args = Array.prototype.slice.call(arguments, 1) |
8 | | - , i = 0; |
| 6 | + console.log = function(text) { |
| 7 | + var args = Array.prototype.slice.call(arguments, 1), |
| 8 | + i = 0; |
9 | 9 |
|
10 | | - text = text.replace(/%\w/g, function() { |
11 | | - return args[i++] || ''; |
12 | | - }); |
| 10 | + text = text.replace(/%\w/g, function() { |
| 11 | + return args[i++] || ''; |
| 12 | + }); |
13 | 13 |
|
14 | | - if (window.console) window.console.log(text); |
15 | | - document.body.innerHTML += '<pre>' + escape(text) + '</pre>'; |
16 | | -}; |
| 14 | + if (window.console) window.console.log(text); |
| 15 | + document.body.innerHTML += '<pre>' + escape(text) + '</pre>'; |
| 16 | + }; |
17 | 17 |
|
18 | | -if (!Object.keys) { |
19 | | - Object.keys = function(obj) { |
20 | | - var out = [] |
21 | | - , key; |
| 18 | + if (!Object.keys) { |
| 19 | + Object.keys = function(obj) { |
| 20 | + var out = [], |
| 21 | + key; |
22 | 22 |
|
23 | | - for (key in obj) { |
24 | | - if (Object.prototype.hasOwnProperty.call(obj, key)) { |
25 | | - out.push(key); |
| 23 | + for (key in obj) { |
| 24 | + if (Object.prototype.hasOwnProperty.call(obj, key)) { |
| 25 | + out.push(key); |
| 26 | + } |
26 | 27 | } |
27 | | - } |
28 | | - |
29 | | - return out; |
30 | | - }; |
31 | | -} |
32 | 28 |
|
33 | | -if (!Array.prototype.forEach) { |
34 | | - Array.prototype.forEach = function(callback, context) { |
35 | | - for (var i = 0; i < this.length; i++) { |
36 | | - callback.call(context || null, this[i], i, obj); |
37 | | - } |
38 | | - }; |
39 | | -} |
| 29 | + return out; |
| 30 | + }; |
| 31 | + } |
40 | 32 |
|
41 | | -if (!String.prototype.trim) { |
42 | | - String.prototype.trim = function() { |
43 | | - return this.replace(/^\s+|\s+$/g, ''); |
44 | | - }; |
45 | | -} |
| 33 | + if (!Array.prototype.forEach) { |
| 34 | + // eslint-disable-next-line no-extend-native |
| 35 | + Array.prototype.forEach = function(callback, context) { |
| 36 | + for (var i = 0; i < this.length; i++) { |
| 37 | + callback.call(context || null, this[i], i, this); |
| 38 | + } |
| 39 | + }; |
| 40 | + } |
46 | 41 |
|
47 | | -function load() { |
48 | | - return files; |
49 | | -} |
| 42 | + if (!String.prototype.trim) { |
| 43 | + // eslint-disable-next-line no-extend-native |
| 44 | + String.prototype.trim = function() { |
| 45 | + return this.replace(/^\s+|\s+$/g, ''); |
| 46 | + }; |
| 47 | + } |
50 | 48 |
|
51 | | -function escape(html, encode) { |
52 | | - return html |
53 | | - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') |
54 | | - .replace(/</g, '<') |
55 | | - .replace(/>/g, '>') |
56 | | - .replace(/"/g, '"') |
57 | | - .replace(/'/g, '''); |
58 | | -} |
| 49 | + // eslint-disable-next-line no-unused-vars |
| 50 | + function load() { |
| 51 | + return files; |
| 52 | + } |
59 | 53 |
|
60 | | -__LIBS__; |
| 54 | + function escape(html, encode) { |
| 55 | + return html |
| 56 | + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') |
| 57 | + .replace(/</g, '<') |
| 58 | + .replace(/>/g, '>') |
| 59 | + .replace(/"/g, '"') |
| 60 | + .replace(/'/g, '''); |
| 61 | + } |
61 | 62 |
|
62 | | -(__MAIN__)(); |
| 63 | + __LIBS__; // eslint-disable-line no-undef, no-unused-expressions |
63 | 64 |
|
| 65 | + (__MAIN__)(); // eslint-disable-line no-undef |
64 | 66 | }).call(this); |
0 commit comments