fix(runtime-dom): compatibility for cases where event.timeStamp is 0 (#1328)

close #1325
This commit is contained in:
Aneryu 2020-06-12 23:00:37 +08:00 committed by GitHub
parent 47c4ffbdbe
commit 90c3532946
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,