Skip to content

Commit ab31460

Browse files
longzhengSukkaWijjk
authored
Check for performance.getEntriesByName before calling (vercel#38186)
* Check for performance. getEntriesByName * Refactor check Co-Authored-By: Sukka <[email protected]> Co-authored-by: Sukka <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
1 parent f3659a5 commit ab31460

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/next/shared/lib/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@ export { warnOnce }
403403
export const SP = typeof performance !== 'undefined'
404404
export const ST =
405405
SP &&
406-
typeof performance.mark === 'function' &&
407-
typeof performance.measure === 'function'
406+
(['mark', 'measure', 'getEntriesByName'] as const).every(
407+
(method) => typeof performance[method] === 'function'
408+
)
408409

409410
export class DecodeError extends Error {}
410411
export class NormalizeError extends Error {}

0 commit comments

Comments
 (0)