(zone: NgZonePrivate)
| 382 | } |
| 383 | |
| 384 | function delayChangeDetectionForEvents(zone: NgZonePrivate) { |
| 385 | /** |
| 386 | * We also need to check _nesting here |
| 387 | * Consider the following case with shouldCoalesceRunChangeDetection = true |
| 388 | * |
| 389 | * ngZone.run(() => {}); |
| 390 | * ngZone.run(() => {}); |
| 391 | * |
| 392 | * We want the two `ngZone.run()` only trigger one change detection |
| 393 | * when shouldCoalesceRunChangeDetection is true. |
| 394 | * And because in this case, change detection run in async way(requestAnimationFrame), |
| 395 | * so we also need to check the _nesting here to prevent multiple |
| 396 | * change detections. |
| 397 | */ |
| 398 | if (zone.isCheckStableRunning || zone.callbackScheduled) { |
| 399 | return; |
| 400 | } |
| 401 | zone.callbackScheduled = true; |
| 402 | function scheduleCheckStable() { |
| 403 | scheduleCallbackWithRafRace(() => { |
| 404 | zone.callbackScheduled = false; |
| 405 | updateMicroTaskStatus(zone); |
| 406 | zone.isCheckStableRunning = true; |
| 407 | checkStable(zone); |
| 408 | zone.isCheckStableRunning = false; |
| 409 | }); |
| 410 | } |
| 411 | if (zone.scheduleInRootZone) { |
| 412 | Zone.root.run(() => { |
| 413 | scheduleCheckStable(); |
| 414 | }); |
| 415 | } else { |
| 416 | zone._outer.run(() => { |
| 417 | scheduleCheckStable(); |
| 418 | }); |
| 419 | } |
| 420 | updateMicroTaskStatus(zone); |
| 421 | } |
| 422 | |
| 423 | function forkInnerZoneWithAngularBehavior(zone: NgZonePrivate) { |
| 424 | const delayChangeDetectionForEventsDelegate = () => { |
no test coverage detected