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

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

Issue 11410076: Issue 6711. Fix for NPE in resolver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index e159ffca9b37967dbcbaaa3a5b5e6e8d6450abb4..71d67b201cbe9b55f010857ed3d62d0227f2b3bb 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1507,13 +1507,9 @@ public class Resolver {
if (element == null) {
element = getContext().getScope().findElement(null, name);
}
- if (element != null) {
- Element enclosingLibrary = Elements.getLibraryElement(enclosingElement);
- Element identifierEnclosingLibrary = Elements.getLibraryElement(element);
- if (!enclosingLibrary.equals(identifierEnclosingLibrary)) {
- onError(diagnosticNode, ResolverErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, name);
- return true;
- }
+ if (!Elements.areSameLibrary(enclosingElement, element)) {
+ onError(diagnosticNode, ResolverErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, name);
+ return true;
}
}
return false;
@@ -1681,10 +1677,8 @@ public class Resolver {
break;
case CONSTRUCTOR:
if (enclosingElement != null) {
- Element enclosingLibrary = Elements.getLibraryElement(enclosingElement);
- Element constructorEnclosingLibrary = Elements.getLibraryElement(element);
if (element != null && DartIdentifier.isPrivateName(element.getName())
- && !enclosingLibrary.equals(constructorEnclosingLibrary)) {
+ && !Elements.areSameLibrary(enclosingElement, element)) {
onError(x.getConstructor(), ResolverErrorCode.ILLEGAL_ACCESS_TO_PRIVATE,
element.getName());
return null;

Powered by Google App Engine
This is Rietveld 408576698