fix(runtime-core/scheduler): allow component render functions to trigger itself

fix #1801
This commit is contained in:
Evan You
2020-08-13 17:27:14 -04:00
parent bc6f252c4a
commit 611437a3fe
4 changed files with 24 additions and 12 deletions

View File

@@ -451,7 +451,7 @@ describe('scheduler', () => {
expect(count).toBe(1)
})
test('should allow watcher callbacks to trigger itself', async () => {
test('should allow explicitly marked jobs to trigger itself', async () => {
// normal job
let count = 0
const job = () => {
@@ -460,7 +460,7 @@ describe('scheduler', () => {
queueJob(job)
}
}
job.cb = true
job.allowRecurse = true
queueJob(job)
await nextTick()
expect(count).toBe(3)
@@ -472,7 +472,7 @@ describe('scheduler', () => {
queuePostFlushCb(cb)
}
}
cb.cb = true
cb.allowRecurse = true
queuePostFlushCb(cb)
await nextTick()
expect(count).toBe(5)