Chromium Code Reviews| Index: pkg/analyzer/lib/src/dart/element/element.dart |
| diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart |
| index 6f4190e072656c5735091b3da79a9fcb22db00c7..e84dff2095823f606619abe35630e394c838f78f 100644 |
| --- a/pkg/analyzer/lib/src/dart/element/element.dart |
| +++ b/pkg/analyzer/lib/src/dart/element/element.dart |
| @@ -16,6 +16,7 @@ import 'package:analyzer/src/dart/ast/utilities.dart'; |
| import 'package:analyzer/src/dart/element/type.dart'; |
| import 'package:analyzer/src/generated/constant.dart' |
| show DartObject, EvaluationResultImpl; |
| +import 'package:analyzer/src/generated/element_handle.dart'; |
| import 'package:analyzer/src/generated/engine.dart' |
| show AnalysisContext, AnalysisEngine; |
| import 'package:analyzer/src/generated/java_core.dart'; |
| @@ -3265,6 +3266,17 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement { |
| indices[library] = index; |
| active.add(library); |
| stack.add(library); |
| + LibraryElementImpl getActualLibrary(LibraryElement lib) { |
| + // TODO(paulberry): this means that computing a library cycle will be |
| + // expensive for libraries resynthesized from summaries, since it will |
| + // require fully resynthesizing all the libraries in the cycle as well |
| + // as any libraries they import or export. Try to find a better way. |
|
Brian Wilkerson
2016/02/25 20:47:39
Eventually, resynthesis should be lazy, in which c
Paul Berry
2016/02/25 21:08:30
Yes, I hope to do that, but even under the optimis
|
| + if (lib is LibraryElementHandle) { |
| + return lib.actualElement; |
| + } else { |
| + return lib; |
| + } |
| + } |
| void recurse(LibraryElementImpl child) { |
| if (!indices.containsKey(child)) { |
| // We haven't visited this child yet, so recurse on the child, |
| @@ -3282,9 +3294,11 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement { |
| // Recurse on all of the children in the import/export graph, filtering |
| // out those for which library cycles have already been computed. |
| library.exportedLibraries |
| + .map(getActualLibrary) |
| .where((l) => l._libraryCycle == null) |
| .forEach(recurse); |
| library.importedLibraries |
| + .map(getActualLibrary) |
| .where((l) => l._libraryCycle == null) |
| .forEach(recurse); |