From dc6ad3b097d6f517684ef5f7985dc0332f6eacdd Mon Sep 17 00:00:00 2001 From: chenyuzhe Date: Tue, 9 Jun 2020 16:35:15 +0800 Subject: [PATCH] fix(runtime-dom): compatible event.timeStamp may be 0 (#1325) --- packages/runtime-dom/src/modules/events.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime-dom/src/modules/events.ts b/packages/runtime-dom/src/modules/events.ts index 57f33b6d1f9..f146a3f8f6e 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,