Merge branch 'main' of https://github.com/vuejs/core
This commit is contained in:
@@ -534,4 +534,16 @@ describe('scheduler', () => {
|
||||
// should not be called
|
||||
expect(spy).toHaveBeenCalledTimes(0)
|
||||
})
|
||||
|
||||
it('flushPreFlushCbs inside a pre job', async () => {
|
||||
const spy = jest.fn()
|
||||
const job = () => {
|
||||
spy()
|
||||
flushPreFlushCbs()
|
||||
}
|
||||
job.pre = true
|
||||
queueJob(job)
|
||||
await nextTick()
|
||||
expect(spy).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/runtime-core",
|
||||
"version": "3.2.38",
|
||||
"version": "3.2.39",
|
||||
"description": "@vue/runtime-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-core.esm-bundler.js",
|
||||
@@ -32,7 +32,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.2.38",
|
||||
"@vue/reactivity": "3.2.38"
|
||||
"@vue/shared": "3.2.39",
|
||||
"@vue/reactivity": "3.2.39"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,11 @@ export function queuePostFlushCb(cb: SchedulerJobs) {
|
||||
queueFlush()
|
||||
}
|
||||
|
||||
export function flushPreFlushCbs(seen?: CountMap, i = flushIndex) {
|
||||
export function flushPreFlushCbs(
|
||||
seen?: CountMap,
|
||||
// if currently flushing, skip the current job itself
|
||||
i = isFlushing ? flushIndex + 1 : 0
|
||||
) {
|
||||
if (__DEV__) {
|
||||
seen = seen || new Map()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user