From: Evan You Date: Tue, 28 Jul 2020 16:29:43 +0000 (-0400) Subject: fix(runtime-core): scheduler should allow intentional self triggering effects X-Git-Tag: v3.0.0-rc.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c27dfe1d0994c65de601760d082cf4668dc3fad0;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-core): scheduler should allow intentional self triggering effects fix #1727 --- diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 33743dce63..b54f5469ce 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -26,7 +26,7 @@ export function nextTick(fn?: () => void): Promise { } 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) }