| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library deferred_load; | 5 library deferred_load; |
| 6 | 6 |
| 7 import 'common/backend_api.dart' show | 7 import 'common/backend_api.dart' show |
| 8 Backend; | 8 Backend; |
| 9 import 'common/tasks.dart' show | 9 import 'common/tasks.dart' show |
| 10 CompilerTask; | 10 CompilerTask; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 /// Finds all elements and constants that [element] depends directly on. | 239 /// Finds all elements and constants that [element] depends directly on. |
| 240 /// (not the transitive closure.) | 240 /// (not the transitive closure.) |
| 241 /// | 241 /// |
| 242 /// Adds the results to [elements] and [constants]. | 242 /// Adds the results to [elements] and [constants]. |
| 243 void _collectAllElementsAndConstantsResolvedFrom( | 243 void _collectAllElementsAndConstantsResolvedFrom( |
| 244 Element element, | 244 Element element, |
| 245 Set<Element> elements, | 245 Set<Element> elements, |
| 246 Set<ConstantValue> constants, | 246 Set<ConstantValue> constants, |
| 247 isMirrorUsage) { | 247 isMirrorUsage) { |
| 248 | 248 |
| 249 if (element.isErroneous) { |
| 250 // Erroneous elements are ignored. |
| 251 return; |
| 252 } |
| 253 |
| 249 /// Recursively collects all the dependencies of [type]. | 254 /// Recursively collects all the dependencies of [type]. |
| 250 void collectTypeDependencies(DartType type) { | 255 void collectTypeDependencies(DartType type) { |
| 251 if (type is GenericType) { | 256 if (type is GenericType) { |
| 252 type.typeArguments.forEach(collectTypeDependencies); | 257 type.typeArguments.forEach(collectTypeDependencies); |
| 253 } | 258 } |
| 254 if (type is FunctionType) { | 259 if (type is FunctionType) { |
| 255 for (DartType argumentType in type.parameterTypes) { | 260 for (DartType argumentType in type.parameterTypes) { |
| 256 collectTypeDependencies(argumentType); | 261 collectTypeDependencies(argumentType); |
| 257 } | 262 } |
| 258 for (DartType argumentType in type.optionalParameterTypes) { | 263 for (DartType argumentType in type.optionalParameterTypes) { |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 _importingLibrary = importingLibrary; | 889 _importingLibrary = importingLibrary; |
| 885 | 890 |
| 886 String get importingLibraryName { | 891 String get importingLibraryName { |
| 887 String libraryName = _importingLibrary.getLibraryName(); | 892 String libraryName = _importingLibrary.getLibraryName(); |
| 888 return libraryName == "" | 893 return libraryName == "" |
| 889 ? "<unnamed>" | 894 ? "<unnamed>" |
| 890 : libraryName; | 895 : libraryName; |
| 891 } | 896 } |
| 892 | 897 |
| 893 } | 898 } |
| OLD | NEW |