From: Aneryu Date: Fri, 12 Jun 2020 15:00:37 +0000 (+0800) Subject: fix(runtime-dom): compatibility for cases where event.timeStamp is 0 (#1328) X-Git-Tag: v3.0.0-beta.15~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90c35329468e1fbb5cd2c1df2e4efd5b12b4fd41;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-dom): compatibility for cases where event.timeStamp is 0 (#1328) close #1325 --- diff --git a/packages/runtime-dom/src/modules/events.ts b/packages/runtime-dom/src/modules/events.ts index 57f33b6d1f..f146a3f8f6 100644 --- a/packages/runtime-dom/src/modules/events.ts +++ b/packages/runtime-dom/src/modules/events.ts @@ -128,7 +128,8 @@ function createInvoker( // the solution is simple: we save the timestamp when a handler is attached, // and the handler would only fire if the event passed to it was fired // AFTER it was attached. - if (e.timeStamp >= invoker.lastUpdated - 1) { + const timeStamp = e.timeStamp || _getNow() + if (timeStamp >= invoker.lastUpdated - 1) { callWithAsyncErrorHandling( patchStopImmediatePropagation(e, invoker.value), instance,