From cf6673b23d2579af7cfe43918127d30556a786da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 14 Nov 2023 12:03:09 +0100 Subject: fix(ext/node): add APIs perf_hook.performance (#21192) Required for Next.js. --- ext/node/polyfills/perf_hooks.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/node/polyfills/perf_hooks.ts') diff --git a/ext/node/polyfills/perf_hooks.ts b/ext/node/polyfills/perf_hooks.ts index 64c2c3e06..5be2da991 100644 --- a/ext/node/polyfills/perf_hooks.ts +++ b/ext/node/polyfills/perf_hooks.ts @@ -16,7 +16,7 @@ const constants = {}; const performance: & Omit< Performance, - "clearMeasures" | "getEntries" | "getEntriesByName" | "getEntriesByType" + "clearMeasures" | "getEntries" > & { // deno-lint-ignore no-explicit-any @@ -58,6 +58,9 @@ const performance: // deno-lint-ignore no-explicit-any return (shimPerformance as any).timeOrigin; }, + getEntriesByName: (name, type) => + shimPerformance.getEntriesByName(name, type), + getEntriesByType: (type) => shimPerformance.getEntriesByType(type), markResourceTiming: () => {}, // @ts-ignore waiting on update in `deno`, but currently this is // a circular dependency -- cgit v1.2.3