| 45 | // TODO isolatedDeclarations ReactiveFlags.SKIP |
| 46 | |
| 47 | constructor(public detached = false) { |
| 48 | if (!detached && activeEffectScope) { |
| 49 | if (activeEffectScope.active) { |
| 50 | this.parent = activeEffectScope |
| 51 | this.index = |
| 52 | (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( |
| 53 | this, |
| 54 | ) - 1 |
| 55 | } else { |
| 56 | // The parent scope has already stopped, so this child must not become |
| 57 | // a detached live scope. |
| 58 | this._active = false |
| 59 | this._warnOnRun = false |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | get active(): boolean { |
| 65 | return this._active |