Skip to content

Commit 1b9245a

Browse files
justinapplerhansl
authored andcommitted
fix(util): check for definition of window.performance.now before using in mdUtil (angular#9664)
The previous behavior assumes the existence of the now() function in browsers that provide the window.performance API. This change verifies it is available and if not, uses existing fallbacks.
1 parent a73ab43 commit 1b9245a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/util/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in
5959

6060
var $mdUtil = {
6161
dom: {},
62-
now: window.performance ?
62+
now: window.performance && window.performance.now ?
6363
angular.bind(window.performance, window.performance.now) : Date.now || function() {
6464
return new Date().getTime();
6565
},

0 commit comments

Comments
 (0)