Skip to content

Commit

Permalink
fix: improve internal mechanism for handling process_effects
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed May 11, 2024
1 parent 477ebc4 commit 21377ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,15 @@ function process_effects(effect, filter_flags, shallow, collected_effects) {
}

if (effects.length > 0) {
var i;
if ((filter_flags & EFFECT) !== 0) {
for (let i = 0; i < effects.length; i++) {
for (i = 0; i < effects.length; i++) {
collected_effects.push(effects[i]);
}
}

if (!shallow) {
for (var i = 0; i < effects.length; i++) {
for (i = 0; i < effects.length; i++) {
process_effects(effects[i], filter_flags, false, collected_effects);
}
}
Expand Down Expand Up @@ -1164,7 +1165,7 @@ export function pop(component) {
const effects = context_stack_item.e;
if (effects !== null) {
context_stack_item.e = null;
for (let i = 0; i < effects.length; i++) {
for (var i = 0; i < effects.length; i++) {
effect(effects[i]);
}
}
Expand Down

0 comments on commit 21377ce

Please sign in to comment.