-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make zone handlers call zone.run to run callbacks. (#2451)
The platform library `Zone` implementation will change to not use `bindCallbackGuarded` in the `Timer` constructors and top-level `scheduleMicrotask` function. Instead it only calls `registerCallback`, and then the `Zone.create{,Periodic}Timer` and `Zone.scheduleMicrotask` are in charge of using `Zone.runGuarded` on the callback when timer/microtask event happens. This ensures that a surrounding zone's `registerCallback` can't make the callback throw in a way that is outside of the `runGuarded` call. Also makes periodic timers that are delayed past multiple tick points, update their `tick` count by more than one instead of running multiple times, like timers should. Adds testing of using the `FakeAsync`'s `Zone` functions directly, and embedding it in another zone to check that it does run using `Zone.run`. Adds testing of periodic timers incrementing `tick` by more than one.
- Loading branch information
Showing
3 changed files
with
300 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.