Make dominator nullable.
TEST="tested with the added test 'root-dominator-is-null'" Bug: https://github.com/flutter/devtools/issues/3025 Change-Id: Ifd6f926e3ecd486d383b03e8b81289310a653bb4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230882 Reviewed-by: Slava Egorov <vegorov@google.com> Reviewed-by: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com> Commit-Queue: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## 0.7.1
|
||||
|
||||
- Make `CallGraphNode.dominator` nullable.
|
||||
|
||||
## 0.7.0
|
||||
|
||||
- Migrate to null-safety.
|
||||
|
||||
@@ -39,7 +39,7 @@ class CallGraphNode {
|
||||
/// Dominator of this node.
|
||||
///
|
||||
/// Computed by [CallGraph.computeDominators].
|
||||
late CallGraphNode dominator;
|
||||
CallGraphNode? dominator;
|
||||
|
||||
/// Nodes dominated by this node.
|
||||
///
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: vm_snapshot_analysis
|
||||
description: Utilities for analysing AOT snapshot size.
|
||||
version: 0.7.0
|
||||
version: 0.7.1
|
||||
|
||||
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_snapshot_analysis
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ void main() async {
|
||||
test('collapse-by-package', () async {
|
||||
await withFlag(testSource, '--trace_precompiler_to', (json) async {
|
||||
final jsonRaw = await loadJson(File(json));
|
||||
|
||||
final callGraph = loadTrace(jsonRaw).collapse(NodeType.packageNode);
|
||||
|
||||
// Collapsing by package should not collapse dart:* libraries into root
|
||||
@@ -110,5 +111,15 @@ void main() async {
|
||||
expect(callGraph.root.pred, isEmpty);
|
||||
});
|
||||
});
|
||||
|
||||
test('root-dominator-is-null', () async {
|
||||
await withFlag(testSource, '--trace_precompiler_to', (json) async {
|
||||
final jsonRaw = await loadJson(File(json));
|
||||
|
||||
final callGraph = loadTrace(jsonRaw).collapse(NodeType.classNode);
|
||||
|
||||
expect(callGraph.root.dominator, isNull);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user