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 {
2727 }
2828
2929 validateSize (info, debugLibName);
30+ validateParents (info);
3031 compareGraphs (info);
3132 verifyDeps (info);
3233}
@@ -74,6 +75,30 @@ validateSize(AllInfo info, String debugLibName) {
7475 }
7576}
7677
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+
77102class _SizeTracker extends RecursiveInfoVisitor {
78103 /// A library name for which to print debugging information (if not null).
79104 final String _debugLibName;
Original file line number Diff line number Diff line change 11name : dart2js_info
2- version : 0.5.6+2
2+ version : 0.5.6+3
33description : >
44 Libraries and tools to process data produced when running dart2js with
55 --dump-info.
You can’t perform that action at this time.
0 commit comments