Skip to content

Commit

Permalink
fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 7, 2024
1 parent 60d7067 commit 29105fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/runtime/node/perf_hooks/$cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const performance = Object.assign(workerdGlobalPerformance, {
getEntriesByType: unenvPerformance.getEntriesByType.bind(unenvPerformance),
mark: unenvPerformance.mark.bind(unenvPerformance),
markResourceTiming:
// @ts-expect-error undocumented public API
unenvPerformance.markResourceTiming.bind(unenvPerformance),
measure: unenvPerformance.measure.bind(unenvPerformance),
nodeTiming: { ...unenvPerformance.nodeTiming },
Expand Down
24 changes: 7 additions & 17 deletions src/runtime/node/perf_hooks/internal/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,6 @@ export const Performance = class Performance
return entry as any;
}

markResourceTiming(
timingInfo: object,
requestedUrl: string,
initiatorType: string,
global: object,
cacheMode: string,
bodyInfo: object,
responseStatus: number,
deliveryType?: string,
): PerformanceResourceTiming {
// TODO: create a new PerformanceResourceTiming entry
// so that performance.getEntries, getEntriesByName, and getEntriesByType return it
// see: https://nodejs.org/api/perf_hooks.html#performancemarkresourcetimingtiminginfo-requestedurl-initiatortype-global-cachemode-bodyinfo-responsestatus-deliverytype
return new _PerformanceResourceTiming("");
}

measure(
measureName: string,
startOrMeasureOptions?: string | PerformanceMeasureOptions | undefined,
Expand All @@ -96,8 +80,14 @@ export const Performance = class Performance
initiatorType: string,
global: object,
cacheMode: "" | "local",
bodyInfo: object,
responseStatus: number,
deliveryType?: string,
): perf_hooks.PerformanceResourceTiming {
throw createNotImplementedError("Performance.markResourceTiming");
// TODO: create a new PerformanceResourceTiming entry
// so that performance.getEntries, getEntriesByName, and getEntriesByType return it
// see: https://nodejs.org/api/perf_hooks.html#performancemarkresourcetimingtiminginfo-requestedurl-initiatortype-global-cachemode-bodyinfo-responsestatus-deliverytype
return new _PerformanceResourceTiming("");
}
};

Expand Down

0 comments on commit 29105fc

Please sign in to comment.