Check for performance.getEntriesByName before calling (#38186)
* Check for performance. getEntriesByName * Refactor check Co-Authored-By: Sukka <github@skk.moe> Co-authored-by: Sukka <github@skk.moe> Co-authored-by: JJ Kasper <jj@jjsweb.site>
This commit is contained in:
parent
f3659a5f93
commit
ab314605af
1 changed files with 3 additions and 2 deletions
|
@ -403,8 +403,9 @@ export { warnOnce }
|
|||
export const SP = typeof performance !== 'undefined'
|
||||
export const ST =
|
||||
SP &&
|
||||
typeof performance.mark === 'function' &&
|
||||
typeof performance.measure === 'function'
|
||||
(['mark', 'measure', 'getEntriesByName'] as const).every(
|
||||
(method) => typeof performance[method] === 'function'
|
||||
)
|
||||
|
||||
export class DecodeError extends Error {}
|
||||
export class NormalizeError extends Error {}
|
||||
|
|
Loading…
Reference in a new issue