Unverified Commit ab314605 authored by Long Zheng's avatar Long Zheng Committed by GitHub

Check for performance.getEntriesByName before calling (#38186)

* Check for performance. getEntriesByName

* Refactor check
Co-Authored-By: 's avatarSukka <github@skk.moe>
Co-authored-by: 's avatarSukka <github@skk.moe>
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent f3659a5f
...@@ -403,8 +403,9 @@ export { warnOnce } ...@@ -403,8 +403,9 @@ export { warnOnce }
export const SP = typeof performance !== 'undefined' export const SP = typeof performance !== 'undefined'
export const ST = export const ST =
SP && SP &&
typeof performance.mark === 'function' && (['mark', 'measure', 'getEntriesByName'] as const).every(
typeof performance.measure === 'function' (method) => typeof performance[method] === 'function'
)
export class DecodeError extends Error {} export class DecodeError extends Error {}
export class NormalizeError extends Error {} export class NormalizeError extends Error {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment