Skip to content

Commit 1b15608

Browse files
committed
In ts.performance.now, bind window.performance.now
Using an arrow function. Previously, it was set directly to window.performance.now, which fails when used on Chrome.
1 parent 3ad83cb commit 1b15608

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/performance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace ts {
33
declare const performance: { now?(): number } | undefined;
44
/** Gets a timestamp with (at least) ms resolution */
5-
export const timestamp = typeof performance !== "undefined" && performance.now ? performance.now : Date.now ? Date.now : () => +(new Date());
5+
export const timestamp = typeof performance !== "undefined" && performance.now ? () => performance.now() : Date.now ? Date.now : () => +(new Date());
66
}
77

88
/*@internal*/
@@ -106,4 +106,4 @@ namespace ts.performance {
106106
measures = undefined;
107107
profilerEvent = undefined;
108108
}
109-
}
109+
}

0 commit comments

Comments
 (0)