@internal
()
| 550 | |
| 551 | /** @internal */ |
| 552 | _tick(): void { |
| 553 | profiler(ProfilerEvent.ChangeDetectionStart); |
| 554 | |
| 555 | if (this.tracingSnapshot !== null) { |
| 556 | // Ensure we always run `tickImpl()` in the context of the most recent snapshot, |
| 557 | // if one exists. Snapshots may be reference counted by the implementation so |
| 558 | // we want to ensure that if we request a snapshot that we use it. |
| 559 | this.tracingSnapshot.run(TracingAction.CHANGE_DETECTION, this.tickImpl); |
| 560 | } else { |
| 561 | this.tickImpl(); |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | private tickImpl = (): void => { |
| 566 | (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); |