Skip to content

Commit

Permalink
fix(util): check for definition of window.performance.now before usin…
Browse files Browse the repository at this point in the history
…g 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.
  • Loading branch information
justinappler authored and hansl committed Sep 26, 2016
1 parent a73ab43 commit 1b9245a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in

var $mdUtil = {
dom: {},
now: window.performance ?
now: window.performance && window.performance.now ?
angular.bind(window.performance, window.performance.now) : Date.now || function() {
return new Date().getTime();
},
Expand Down

0 comments on commit 1b9245a

Please sign in to comment.