Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java

Issue 10536180: Issue 3530. Import elements into separate import namespace (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
index d620cebc6de0106b7bc4f93fca59a5be55e359d1..f8b2fbc1d2450bc21830742c094447b60bb16764 100644
--- a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
+++ b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
@@ -16,17 +16,14 @@ import com.google.dart.compiler.ast.DartField;
import com.google.dart.compiler.ast.DartFieldDefinition;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartIdentifier;
-import com.google.dart.compiler.ast.DartImportDirective;
import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNode;
-import com.google.dart.compiler.ast.DartStringLiteral;
import com.google.dart.compiler.ast.DartTypeParameter;
import com.google.dart.compiler.ast.DartUnit;
-import com.google.dart.compiler.ast.LibraryNode;
+import com.google.dart.compiler.ast.LibraryImport;
import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.ast.Modifiers;
import com.google.dart.compiler.common.SourceInfo;
-import com.google.dart.compiler.parser.DartParser;
import com.google.dart.compiler.type.Type;
import com.google.dart.compiler.type.TypeVariable;
import com.google.dart.compiler.type.Types;
@@ -69,8 +66,9 @@ public class TopLevelElementBuilder {
assert scope.getElements().isEmpty();
Map<String, LibraryPrefixElement> libraryPrefixElements = Maps.newHashMap();
- for (LibraryUnit lib : library.getImports()) {
- String prefix = library.getPrefixOf(lib);
+ for (LibraryImport libraryImport : library.getImports()) {
+ LibraryUnit lib = libraryImport.getLibrary();
+ String prefix = libraryImport.getPrefix();
if (prefix != null) {
// Put the prefix in the scope.
LibraryPrefixElement libraryPrefixElement = libraryPrefixElements.get(prefix);
@@ -87,8 +85,7 @@ public class TopLevelElementBuilder {
} else {
// Put the elements of the library in the scope.
for (DartUnit unit : lib.getUnits()) {
- //fillInUnitScope(unit, listener, importScope, false);
- fillInUnitScope(unit, listener, scope, false);
+ fillInUnitScope(unit, listener, importScope, false);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698