Skip to content

Commit f80fd19

Browse files
committed
Update system.ts
1 parent 19a049e commit f80fd19

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/reactivity/src/system.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ function checkDirty(current: Link): boolean {
262262
let prevLinks: OneWayLink<Link> | undefined
263263
let checkDepth = 0
264264
let dirty: boolean
265+
let shallowPropagated = false
265266

266267
top: do {
267268
dirty = false
@@ -277,6 +278,7 @@ function checkDirty(current: Link): boolean {
277278
const subs = dep.subs!
278279
if (subs.nextSub !== undefined) {
279280
shallowPropagate(subs)
281+
shallowPropagated = true
280282
}
281283
dirty = true
282284
}
@@ -309,6 +311,7 @@ function checkDirty(current: Link): boolean {
309311
current = prevLinks!.target
310312
prevLinks = prevLinks!.linked
311313
shallowPropagate(firstSub)
314+
shallowPropagated = true
312315
} else {
313316
current = firstSub
314317
}
@@ -327,10 +330,13 @@ function checkDirty(current: Link): boolean {
327330
current = current.nextDep
328331
continue top
329332
}
330-
dirty = !!(sub.flags & SubscriberFlags.Dirty)
333+
dirty = shallowPropagated && !!(sub.flags & SubscriberFlags.Dirty)
331334
}
332335

333-
return dirty || !!(current.sub.flags & SubscriberFlags.Dirty)
336+
return (
337+
dirty ||
338+
(shallowPropagated && !!(current.sub.flags & SubscriberFlags.Dirty))
339+
)
334340
} while (true)
335341
}
336342

0 commit comments

Comments
 (0)