Skip to content

Commit a4ccdfc

Browse files
committed
fix: iterate eager effects in reverse to avoid guards running out of order (#16795)
1 parent 350ec9f commit a4ccdfc

File tree

1 file changed

+2
-1
lines changed
  • packages/svelte/src/internal/client/reactivity

1 file changed

+2
-1
lines changed

packages/svelte/src/internal/client/reactivity/batch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ function flush_queued_effects(effects) {
626626
// TODO this feels incorrect! it gets the tests passing
627627
old_values.clear();
628628

629-
for (const e of eager_block_effects) {
629+
// Update effects in reverse order to ensure outer guards are processed before their contents
630+
for (const e of eager_block_effects.toReversed()) {
630631
update_effect(e);
631632
}
632633

0 commit comments

Comments
 (0)