@@ -44,11 +44,11 @@ export class EffectScope {
44
44
constructor ( public detached = false ) {
45
45
this . parent = activeEffectScope
46
46
if ( ! detached && activeEffectScope ) {
47
- if ( activeEffectScope . scopesTail ) {
47
+ if ( activeEffectScope . scopesTail ) {
48
48
this . prevEffectScope = activeEffectScope . scopesTail ;
49
49
activeEffectScope . scopesTail . nextEffectScope = this ;
50
50
activeEffectScope . scopesTail = this ;
51
- } else {
51
+ } else {
52
52
activeEffectScope . scopes = activeEffectScope . scopesTail = this ;
53
53
}
54
54
}
@@ -61,11 +61,10 @@ export class EffectScope {
61
61
pause ( ) : void {
62
62
if ( this . _active ) {
63
63
this . _isPaused = true
64
- let i , l
65
- for ( let child = this . scopes ; child != undefined ; child = child . nextEffectScope ) {
64
+ for ( let child = this . scopes ; child != undefined ; child = child . nextEffectScope ) {
66
65
child . pause ( ) ;
67
66
}
68
- for ( i = 0 , l = this . effects . length ; i < l ; i ++ ) {
67
+ for ( let i = 0 , l = this . effects . length ; i < l ; i ++ ) {
69
68
this . effects [ i ] . pause ( )
70
69
}
71
70
}
@@ -78,11 +77,10 @@ export class EffectScope {
78
77
if ( this . _active ) {
79
78
if ( this . _isPaused ) {
80
79
this . _isPaused = false
81
- let i , l
82
- for ( let child = this . scopes ; child != undefined ; child = child . nextEffectScope ) {
80
+ for ( let child = this . scopes ; child != undefined ; child = child . nextEffectScope ) {
83
81
child . resume ( ) ;
84
82
}
85
- for ( i = 0 , l = this . effects . length ; i < l ; i ++ ) {
83
+ for ( let i = 0 , l = this . effects . length ; i < l ; i ++ ) {
86
84
this . effects [ i ] . resume ( )
87
85
}
88
86
}
@@ -140,23 +138,23 @@ export class EffectScope {
140
138
}
141
139
this . cleanups . length = 0
142
140
143
- for ( let child = this . scopes ; child != undefined ; child = child . nextEffectScope ) {
144
- child . stop ( ) ;
141
+ for ( let child = this . scopes ; child != undefined ; child = child . nextEffectScope ) {
142
+ child . stop ( true ) ;
145
143
}
146
144
this . scopes = this . scopesTail = undefined ;
147
145
148
146
// nested scope, dereference from parent to avoid memory leaks
149
147
if ( ! this . detached && this . parent && ! fromParent ) {
150
- if ( this . prevEffectScope ) {
148
+ if ( this . prevEffectScope ) {
151
149
this . prevEffectScope . nextEffectScope = this . nextEffectScope ;
152
150
}
153
- if ( this . nextEffectScope ) {
151
+ if ( this . nextEffectScope ) {
154
152
this . nextEffectScope . prevEffectScope = this . prevEffectScope ;
155
153
}
156
- if ( this . parent . scopes == this ) {
154
+ if ( this . parent . scopes == this ) {
157
155
this . parent . scopes = this . nextEffectScope ;
158
156
}
159
- if ( this . parent . scopesTail == this ) {
157
+ if ( this . parent . scopesTail == this ) {
160
158
this . parent . scopesTail = this . prevEffectScope ;
161
159
}
162
160
}
0 commit comments