| Index: lib/compiler/implementation/elements/elements.dart
|
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
|
| index 9877fe7daba1d0560bf357351123c8c6eca62e66..2594b087145e86e0f1cc27273207cf5d4f71eb44 100644
|
| --- a/lib/compiler/implementation/elements/elements.dart
|
| +++ b/lib/compiler/implementation/elements/elements.dart
|
| @@ -247,11 +247,7 @@ class Element implements Spannable {
|
|
|
| CompilationUnitElement getCompilationUnit() {
|
| Element element = this;
|
| - while (element !== null && !element.isCompilationUnit()) {
|
| - if (element.isLibrary()) {
|
| - LibraryElement library = element;
|
| - return library.entryCompilationUnit;
|
| - }
|
| + while (!element.isCompilationUnit()) {
|
| element = element.enclosingElement;
|
| }
|
| return element;
|
| @@ -614,6 +610,8 @@ class LibraryElement extends ScopeContainerElement {
|
| LibraryElement get declaration => super.declaration;
|
| LibraryElement get implementation => super.implementation;
|
|
|
| + CompilationUnitElement getCompilationUnit() => entryCompilationUnit;
|
| +
|
| void addCompilationUnit(CompilationUnitElement element) {
|
| compilationUnits = compilationUnits.prepend(element);
|
| }
|
|
|