@@ -588,11 +588,11 @@ export function schedule_effect(signal) {
588
588
*
589
589
* @param {import('#client').Effect } effect
590
590
* @param {number } filter_flags
591
- * @param {boolean } shallow
591
+ * @param {boolean } recursive
592
592
* @param {import('#client').Effect[] } collected_effects
593
593
* @returns {void }
594
594
*/
595
- function process_effects ( effect , filter_flags , shallow , collected_effects ) {
595
+ function process_effects ( effect , filter_flags , recursive , collected_effects ) {
596
596
var current_effect = effect . first ;
597
597
var effects = [ ] ;
598
598
@@ -616,13 +616,13 @@ function process_effects(effect, filter_flags, shallow, collected_effects) {
616
616
// Child might have been mutated since running the effect
617
617
child = current_effect . first ;
618
618
}
619
- if ( ! shallow && child !== null ) {
619
+ if ( recursive && child !== null ) {
620
620
current_effect = child ;
621
621
continue ;
622
622
}
623
623
} else if ( ( flags & EFFECT ) !== 0 ) {
624
624
if ( is_branch || is_clean ) {
625
- if ( ! shallow && child !== null ) {
625
+ if ( recursive && child !== null ) {
626
626
current_effect = child ;
627
627
continue ;
628
628
}
@@ -652,16 +652,12 @@ function process_effects(effect, filter_flags, shallow, collected_effects) {
652
652
current_effect = sibling ;
653
653
}
654
654
655
- if ( effects . length > 0 ) {
655
+ if ( recursive && effects . length > 0 ) {
656
656
// We might be dealing with many effects here, far more than can be spread into
657
657
// an array push call (callstack overflow). So let's deal with each effect in a loop.
658
658
for ( var i = 0 ; i < effects . length ; i ++ ) {
659
- if ( ( filter_flags & EFFECT ) !== 0 ) {
660
- collected_effects . push ( effects [ i ] ) ;
661
- }
662
- if ( ! shallow ) {
663
- process_effects ( effects [ i ] , filter_flags , false , collected_effects ) ;
664
- }
659
+ collected_effects . push ( effects [ i ] ) ;
660
+ process_effects ( effects [ i ] , filter_flags , true , collected_effects ) ;
665
661
}
666
662
}
667
663
}
@@ -674,10 +670,10 @@ function process_effects(effect, filter_flags, shallow, collected_effects) {
674
670
*
675
671
* @param {import('#client').Effect } effect
676
672
* @param {number } filter_flags
677
- * @param {boolean } [shallow ]
673
+ * @param {boolean } [recursive ]
678
674
* @returns {void }
679
675
*/
680
- function flush_nested_effects ( effect , filter_flags , shallow = false ) {
676
+ function flush_nested_effects ( effect , filter_flags , recursive = true ) {
681
677
/** @type {import('#client').Effect[] } */
682
678
var collected_effects = [ ] ;
683
679
@@ -689,7 +685,7 @@ function flush_nested_effects(effect, filter_flags, shallow = false) {
689
685
if ( effect . first === null && ( effect . f & BRANCH_EFFECT ) === 0 ) {
690
686
flush_queued_effects ( [ effect ] ) ;
691
687
} else {
692
- process_effects ( effect , filter_flags , shallow , collected_effects ) ;
688
+ process_effects ( effect , filter_flags , recursive , collected_effects ) ;
693
689
flush_queued_effects ( collected_effects ) ;
694
690
}
695
691
} finally {
@@ -705,7 +701,7 @@ export function flush_local_render_effects(effect) {
705
701
infinite_loop_guard ( ) ;
706
702
// We are entering a new flush sequence, so ensure counter is reset.
707
703
flush_count = 0 ;
708
- flush_nested_effects ( effect , RENDER_EFFECT , true ) ;
704
+ flush_nested_effects ( effect , RENDER_EFFECT , false ) ;
709
705
}
710
706
711
707
/**
0 commit comments