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

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

Issue 10139017: Support for same prefix for multiple imports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Detect top-level duplicates in libraries with same prefix Created 8 years, 8 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/Scope.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Scope.java b/compiler/java/com/google/dart/compiler/resolver/Scope.java
index 7175766ef2ae035ccae399585b40a5647a12e0cb..f76adf20288db1428160f36ad2120a0b1292cf7e 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Scope.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Scope.java
@@ -38,6 +38,21 @@ public class Scope {
}
public Element declareElement(String name, Element element) {
+// // One prefix can be used to import several libraries.
+// // So, we wrap LibraryElements into LibraryPrefixElement
+// if (element instanceof LibraryElement) {
zundel 2012/04/21 00:41:17 remove commented out code.
+// Element existingElement = elements.get(name);
+// if (existingElement == null || existingElement instanceof LibraryPrefixElement) {
+// LibraryPrefixElement prefixElement = (LibraryPrefixElement) existingElement;
+// if (prefixElement == null) {
+// prefixElement = new LibraryPrefixElementImplementation(name, this);
+// elements.put(name, prefixElement);
+// }
+// prefixElement.addLibrary((LibraryElement) element);
+// return null;
+// }
+// }
+// // Normal element.
return elements.put(name, element);
}

Powered by Google App Engine
This is Rietveld 408576698