-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow analysis: replace context toString methods with a less fragile m…
…echanism. Adds getters `_debugFields` and `_debugType` to the `_FlowContext` base class, and adds a single implementation of `_FlowContext.toString` that builds a representation of the context based on them. This replaces the implementations of `toString` in all the classes derived from `_FlowContext`, which were more difficult to get right and keep synchronized with code changes. Also changes `_TryFinallyContext` from a `late final` variable to a nullable variable. This sacrifices a tiny bit of safety, but has the advantage of allowing `toString` to show the value if it's been initialized, and avoid crashing if it hasn't. Change-Id: I0ca3ddfed21934c54eaba912c84edda79c8eadfc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276202 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Paul Berry <[email protected]>
- Loading branch information
1 parent
8e1f576
commit e64c60d
Showing
1 changed file
with
131 additions
and
43 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