]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
perf: improve the performance of getNow (#5944)
authorzhangenming <282126346@qq.com>
Mon, 23 May 2022 00:36:57 +0000 (08:36 +0800)
committerGitHub <noreply@github.com>
Mon, 23 May 2022 00:36:57 +0000 (20:36 -0400)
packages/runtime-dom/src/modules/events.ts

index a4cb61e88fe9cc049b07dcc7ef7905b72a7c34c6..bd2279cf5f2bdbb9f7016d760bf4c6e02f2d1d77 100644 (file)
@@ -25,7 +25,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
       // if the low-res timestamp which is bigger than the event timestamp
       // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
       // and we need to use the hi-res version for event listeners as well.
-      _getNow = () => performance.now()
+      _getNow = performance.now.bind(performance)
     }
     // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
     // and does not fire microtasks in between event propagation, so safe to exclude.