From 3a2234755992a56936a58b9829da454852d0b9db Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 7 Jun 2021 13:32:50 -0400 Subject: [PATCH] fix(utils): Check for performance.now() when calculating browser timing We should guard against performance.now not being available when calculating browserPerformanceTimeOrigin. We do a similar check when for our wrapper around the native performance api implementation. --- packages/utils/src/time.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/time.ts b/packages/utils/src/time.ts index 5ef33920a4cc..62beac716f02 100644 --- a/packages/utils/src/time.ts +++ b/packages/utils/src/time.ts @@ -141,7 +141,7 @@ export const browserPerformanceTimeOrigin = ((): number | undefined => { // data as reliable if they are within a reasonable threshold of the current time. const { performance } = getGlobalObject(); - if (!performance) { + if (!performance || !performance.now) { _browserPerformanceTimeOriginMode = 'none'; return undefined; }