| 251 | **/ |
| 252 | let activeEffectScope; |
| 253 | class EffectScope { |
| 254 | // TODO isolatedDeclarations "__v_skip" |
| 255 | constructor(detached = false) { |
| 256 | this.detached = detached; |
| 257 | this._active = true; |
| 258 | this._on = 0; |
| 259 | this.effects = []; |
| 260 | this.cleanups = []; |
| 261 | this._isPaused = false; |
| 262 | this._warnOnRun = true; |
| 263 | this.__v_skip = true; |
| 264 | if (!detached && activeEffectScope) { |
| 265 | if (activeEffectScope.active) { |
| 266 | this.parent = activeEffectScope; |
| 267 | this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( |
| 268 | this |
| 269 | ) - 1; |
| 270 | } else { |
| 271 | this._active = false; |
| 272 | this._warnOnRun = false; |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | get active() { |
| 277 | return this._active; |
| 278 | } |
| 279 | pause() { |
| 280 | if (this._active) { |
| 281 | this._isPaused = true; |
| 282 | let i, l; |
| 283 | if (this.scopes) { |
| 284 | for (i = 0, l = this.scopes.length; i < l; i++) { |
| 285 | this.scopes[i].pause(); |
| 286 | } |
| 287 | } |
| 288 | for (i = 0, l = this.effects.length; i < l; i++) { |
| 289 | this.effects[i].pause(); |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | /** |
| 294 | * Resumes the effect scope, including all child scopes and effects. |
| 295 | */ |
| 296 | resume() { |
| 297 | if (this._active) { |
| 298 | if (this._isPaused) { |
| 299 | this._isPaused = false; |
| 300 | let i, l; |
| 301 | if (this.scopes) { |
| 302 | for (i = 0, l = this.scopes.length; i < l; i++) { |
| 303 | this.scopes[i].resume(); |
| 304 | } |
| 305 | } |
| 306 | for (i = 0, l = this.effects.length; i < l; i++) { |
| 307 | this.effects[i].resume(); |
| 308 | } |
| 309 | } |
| 310 | } |
nothing calls this directly
no outgoing calls
no test coverage detected