From: zhangenming <282126346@qq.com> Date: Mon, 23 May 2022 00:36:57 +0000 (+0800) Subject: perf: improve the performance of getNow (#5944) X-Git-Tag: v3.2.36~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3bdc41dff305422cb5334a64353c314bce1202a4;p=thirdparty%2Fvuejs%2Fcore.git perf: improve the performance of getNow (#5944) --- diff --git a/packages/runtime-dom/src/modules/events.ts b/packages/runtime-dom/src/modules/events.ts index a4cb61e88f..bd2279cf5f 100644 --- a/packages/runtime-dom/src/modules/events.ts +++ b/packages/runtime-dom/src/modules/events.ts @@ -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.