OLD | NEW |
---|---|
(Empty) | |
1 /** | |
2 * @fileoverview Description of this file. | |
3 */ | |
4 | |
5 var goog = {}; | |
scherkus (not reviewing)
2013/07/18 02:18:10
what's the origin of this file?
is it copied from
Ty Overby
2013/07/18 16:57:17
Kind of. It uses the same names and sometimes the
| |
6 goog.object = {}; | |
7 goog.object.forEach = function (obj, f, optObj) { | |
8 "use strict"; | |
9 var key; | |
10 for (key in obj) { | |
11 if (obj.hasOwnProperty(key)) { | |
12 f.call(optObj, obj[key], key, obj); | |
13 } | |
14 } | |
15 }; | |
16 | |
17 goog.array = {}; | |
18 goog.array.forEach = function (arr, f, env) { | |
19 "use strict"; | |
20 | |
21 f = f.bind(env); | |
22 | |
23 var len = arr.length, | |
24 i = 0; | |
25 for (i = 0; i < len; i += 1) { | |
26 f(arr[i]); | |
27 } | |
28 }; | |
29 | |
30 goog.array.filter = function (arr, f) { | |
31 "use strict"; | |
32 return arr.filter(f); | |
33 }; | |
34 | |
35 goog.array.map = function (arr, f) { | |
36 "use strict"; | |
37 return arr.map(f); | |
38 }; | |
39 | |
40 goog.time = {}; | |
41 goog.time.millisToString = function (timeMillis) { | |
42 "use strict"; | |
43 function pad(num) { | |
44 num = num.toString(); | |
45 if (num.length < 2) { | |
46 return "0" + num; | |
47 } | |
48 return num; | |
49 } | |
50 | |
51 var date = new Date(timeMillis); | |
52 return pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + | |
53 pad(date.getUTCSeconds()) + ' ' + pad((date.getMilliseconds()) % 1000); | |
54 }; | |
OLD | NEW |