Skip to content

Commit 960acce

Browse files
committed
eslint fixes
1 parent ba2e5ff commit 960acce

1 file changed

Lines changed: 22 additions & 18 deletions

File tree

v3/src/polyfills/performance.now.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@
66
/**
77
* performance.now
88
*/
9-
(function(){
9+
(function () {
1010

11-
if ("performance" in window == false) {
12-
window.performance = {};
13-
}
14-
15-
Date.now = (Date.now || function () { // thanks IE8
16-
return new Date().getTime();
17-
});
18-
19-
if ("now" in window.performance == false)
20-
{
21-
var nowOffset = Date.now();
22-
23-
if (performance.timing && performance.timing.navigationStart){
24-
nowOffset = performance.timing.navigationStart
11+
if ('performance' in window === false)
12+
{
13+
window.performance = {};
2514
}
2615

27-
window.performance.now = function now(){
28-
return Date.now() - nowOffset;
16+
// Thanks IE8
17+
Date.now = (Date.now || function () {
18+
return new Date().getTime();
19+
});
20+
21+
if ('now' in window.performance === false)
22+
{
23+
var nowOffset = Date.now();
24+
25+
if (performance.timing && performance.timing.navigationStart)
26+
{
27+
nowOffset = performance.timing.navigationStart;
28+
}
29+
30+
window.performance.now = function now ()
31+
{
32+
return Date.now() - nowOffset;
33+
}
2934
}
30-
}
3135

3236
})();

0 commit comments

Comments
 (0)