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

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

Issue 8662019: Support for parsing returning qualified type. Issue 513. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak write spaces Created 9 years, 1 month 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/ResolutionContext.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
index 14faa444ef5c32a61fd18ff7ceed3892e8fba14c..251d3962186a0347533b8d678fe82f715476f1fb 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
@@ -278,17 +278,16 @@ public class ResolutionContext implements ResolutionErrorListener {
@Override
public Element visitPropertyAccess(DartPropertyAccess node) {
Element element = node.getQualifier().accept(this);
- switch (element.getKind()) {
- case LIBRARY:
- Scope elementScope = ((LibraryElement) element).getScope();
- return elementScope.findElement(scope.getLibrary(), node.getPropertyName());
-
- case CLASS:
- return Elements.findElement((ClassElement) element, node.getPropertyName());
-
- default:
- return null;
+ if (element != null) {
+ switch (element.getKind()) {
+ case LIBRARY :
+ Scope elementScope = ((LibraryElement) element).getScope();
+ return elementScope.findElement(scope.getLibrary(), node.getPropertyName());
+ case CLASS :
+ return Elements.findElement((ClassElement) element, node.getPropertyName());
+ }
}
+ return null;
}
@Override

Powered by Google App Engine
This is Rietveld 408576698