Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(reactivity): prevent crash when mutating effect scopes during tra…
…versal
  • Loading branch information
Askerka00 committed Jul 14, 2026
commit 59c086692b36fe859384074e33c37b2153bac804
15 changes: 9 additions & 6 deletions packages/reactivity/src/effectScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ export class EffectScope {
this._isPaused = true
let i, l
if (this.scopes) {
for (i = 0, l = this.scopes.length; i < l; i++) {
this.scopes[i].pause()
const scopes = this.scopes.slice()
for (i = 0, l = scopes.length; i < l; i++) {
scopes[i].pause()
}
}
for (i = 0, l = this.effects.length; i < l; i++) {
Expand All @@ -89,8 +90,9 @@ export class EffectScope {
this._isPaused = false
let i, l
if (this.scopes) {
for (i = 0, l = this.scopes.length; i < l; i++) {
this.scopes[i].resume()
const scopes = this.scopes.slice()
for (i = 0, l = scopes.length; i < l; i++) {
scopes[i].resume()
}
}
for (i = 0, l = this.effects.length; i < l; i++) {
Expand Down Expand Up @@ -171,8 +173,9 @@ export class EffectScope {
this.cleanups.length = 0

if (this.scopes) {
for (i = 0, l = this.scopes.length; i < l; i++) {
this.scopes[i].stop(true)
const scopes = this.scopes.slice()
for (i = 0, l = scopes.length; i < l; i++) {
scopes[i].stop(true)
}
this.scopes.length = 0
}
Expand Down
Loading