Skip to content

Commit 202922b

Browse files
committed
chore: improve code
1 parent c75a29a commit 202922b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/runtime-core/__tests__/apiWatch.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ describe('api: watch', () => {
553553
// #7030
554554
it('should not fire on child component unmount w/ flush: pre', async () => {
555555
const visible = ref(true)
556-
const cb = jest.fn()
556+
const cb = vi.fn()
557557
const Parent = defineComponent({
558558
props: ['visible'],
559559
render() {

packages/runtime-core/src/scheduler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ export function flushPreFlushCbs(
145145
for (; i < queue.length; i++) {
146146
const cb = queue[i]
147147
if (cb && cb.pre) {
148-
if (__DEV__ && checkRecursiveUpdates(seen!, cb)) {
148+
if (instance && cb.id !== instance.uid) {
149149
continue
150150
}
151-
if (instance && cb.id !== instance.uid) {
151+
if (__DEV__ && checkRecursiveUpdates(seen!, cb)) {
152152
continue
153153
}
154154
queue.splice(i, 1)

0 commit comments

Comments
 (0)