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