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