]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): scheduler should allow intentional self triggering effects
authorEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 16:29:43 +0000 (12:29 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 16:29:43 +0000 (12:29 -0400)
fix #1727

packages/runtime-core/src/scheduler.ts

index 33743dce639cbe944468581a84ee8e481d59f9f2..b54f5469ce2d195cc1409fd0f068225f47ba1877 100644 (file)
@@ -26,7 +26,7 @@ export function nextTick(fn?: () => void): Promise<void> {
 }
 
 export function queueJob(job: Job) {
-  if (!queue.includes(job, flushIndex)) {
+  if (!queue.includes(job, flushIndex + 1)) {
     queue.push(job)
     queueFlush()
   }
@@ -43,7 +43,7 @@ export function queuePostFlushCb(cb: Function | Function[]) {
   if (!isArray(cb)) {
     if (
       !pendingPostFlushCbs ||
-      !pendingPostFlushCbs.includes(cb, pendingPostFlushIndex)
+      !pendingPostFlushCbs.includes(cb, pendingPostFlushIndex + 1)
     ) {
       postFlushCbs.push(cb)
     }