]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): fix scheduler dedupe when not flushing
authorEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 17:23:09 +0000 (13:23 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 17:23:09 +0000 (13:23 -0400)
packages/runtime-core/src/scheduler.ts

index b54f5469ce2d195cc1409fd0f068225f47ba1877..07ee84a398244c6668a9ba722117e3a8a1e024fb 100644 (file)
@@ -13,7 +13,7 @@ let currentFlushPromise: Promise<void> | null = null
 
 let isFlushing = false
 let isFlushPending = false
-let flushIndex = 0
+let flushIndex = -1
 let pendingPostFlushCbs: Function[] | null = null
 let pendingPostFlushIndex = 0
 
@@ -114,7 +114,7 @@ function flushJobs(seen?: CountMap) {
       callWithErrorHandling(job, null, ErrorCodes.SCHEDULER)
     }
   }
-  flushIndex = 0
+  flushIndex = -1
   queue.length = 0
 
   flushPostFlushCbs(seen)