@@ -679,10 +679,7 @@ function flush_queued_root_effects(root_effects) {
679679 effect . f ^= CLEAN ;
680680 }
681681
682- /** @type {Effect[] } */
683- var collected_effects = [ ] ;
684-
685- process_effects ( effect , collected_effects ) ;
682+ var collected_effects = process_effects ( effect ) ;
686683 flush_queued_effects ( collected_effects ) ;
687684 }
688685 } finally {
@@ -783,10 +780,12 @@ export function schedule_effect(signal) {
783780 * effects to be flushed.
784781 *
785782 * @param {Effect } effect
786- * @param {Effect[] } collected_effects
787- * @returns {void }
783+ * @returns {Effect[] }
788784 */
789- function process_effects ( effect , collected_effects ) {
785+ function process_effects ( effect ) {
786+ /** @type {Effect[] } */
787+ var effects = [ ] ;
788+
790789 var current_effect = effect . first ;
791790
792791 main_loop: while ( current_effect !== null ) {
@@ -797,7 +796,7 @@ function process_effects(effect, collected_effects) {
797796
798797 if ( ! is_skippable_branch && ( flags & INERT ) === 0 ) {
799798 if ( ( flags & EFFECT ) !== 0 ) {
800- collected_effects . push ( current_effect ) ;
799+ effects . push ( current_effect ) ;
801800 } else if ( is_branch ) {
802801 current_effect . f ^= CLEAN ;
803802 } else {
@@ -843,6 +842,8 @@ function process_effects(effect, collected_effects) {
843842
844843 current_effect = sibling ;
845844 }
845+
846+ return effects ;
846847}
847848
848849/**
0 commit comments