From 686ec85f5220327933d1dfae0e73dabbfc33bc45 Mon Sep 17 00:00:00 2001 From: await-ovo <13152410380@163.com> Date: Wed, 5 Jul 2023 01:19:18 +0800 Subject: fix(ext/node): Define performance.timeOrigin as getter property (#19714) --- ext/node/polyfills/perf_hooks.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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 059677c9b..64c2c3e06 100644 --- a/ext/node/polyfills/perf_hooks.ts +++ b/ext/node/polyfills/perf_hooks.ts @@ -54,8 +54,10 @@ const performance: nodeTiming: {}, now: () => shimPerformance.now(), timerify: () => notImplemented("timerify from performance"), - // deno-lint-ignore no-explicit-any - timeOrigin: (shimPerformance as any).timeOrigin, + get timeOrigin() { + // deno-lint-ignore no-explicit-any + return (shimPerformance as any).timeOrigin; + }, markResourceTiming: () => {}, // @ts-ignore waiting on update in `deno`, but currently this is // a circular dependency -- cgit v1.2.3