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

Unified Diff: compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java

Issue 8359002: Fix libraryDepsVisitor to properly track prefixed library references (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/end2end/End2EndTests.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java
diff --git a/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java b/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java
index 47c980ef69340cdb6b4406dbbc6c3327ad23257c..1e4f541773ff8b5463842ad60bc52e1f79b1fd73 100644
--- a/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java
+++ b/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java
@@ -90,7 +90,17 @@ public class LibraryDepsVisitor extends DartNodeTraverser<Void> {
@Override
public Void visitPropertyAccess(DartPropertyAccess node) {
- // Skip rhs of property accesses, so that all identifiers we visit will be unqualified.
+ if (node.getQualifier() instanceof DartIdentifier) {
+ DartIdentifier qualifier = (DartIdentifier) node.getQualifier();
+ Element target = qualifier.getTargetSymbol();
+ if (target != null && target.getKind() == ElementKind.LIBRARY) {
+ // Handle library prefixes normally (the prefix part of the qualifier
+ // doesn't contain any resolvable library source info)
+ return super.visitPropertyAccess(node);
+ }
+ }
+ // Skip rhs of property accesses, so that all identifiers we visit will be
+ // unqualified.
return node.getQualifier().accept(this);
}
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/end2end/End2EndTests.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698