File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ main(args) async {
27
27
}
28
28
29
29
validateSize (info, debugLibName);
30
+ validateParents (info);
30
31
compareGraphs (info);
31
32
verifyDeps (info);
32
33
}
@@ -74,6 +75,30 @@ validateSize(AllInfo info, String debugLibName) {
74
75
}
75
76
}
76
77
78
+ /// Validates that every element in the model has a parent (except libraries).
79
+ validateParents (AllInfo info) {
80
+ final parentlessInfos = new Set <Info >();
81
+
82
+ failIfNoParents (List <Info > infos) {
83
+ for (var info in infos) {
84
+ if (info.parent == null ) {
85
+ parentlessInfos.add (info);
86
+ }
87
+ }
88
+ }
89
+
90
+ failIfNoParents (info.functions);
91
+ failIfNoParents (info.typedefs);
92
+ failIfNoParents (info.classes);
93
+ failIfNoParents (info.fields);
94
+ failIfNoParents (info.closures);
95
+ if (parentlessInfos.isEmpty) {
96
+ _pass ('all elements have a parent' );
97
+ } else {
98
+ _fail ('${parentlessInfos .length } elements have no parent' );
99
+ }
100
+ }
101
+
77
102
class _SizeTracker extends RecursiveInfoVisitor {
78
103
/// A library name for which to print debugging information (if not null).
79
104
final String _debugLibName;
Original file line number Diff line number Diff line change 1
1
name : dart2js_info
2
- version : 0.5.6+2
2
+ version : 0.5.6+3
3
3
description : >
4
4
Libraries and tools to process data produced when running dart2js with
5
5
--dump-info.
You can’t perform that action at this time.
0 commit comments