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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.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
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/Resolver.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 49694ff9d1629c016479d627c9ab3d0cdf93f045..1ca3593b0e7cf4e0710d47a3d511ee05466988a6 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -1569,12 +1569,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
private void checkIllegalPrivateAccess(DartNode diagnosticNode, Element element, String name) {
if (DartIdentifier.isPrivateName(name)) {
- if (element != null) {
- Element enclosingLibrary = Elements.getLibraryElement(currentMethod);
- Element identifierEnclosingLibrary = Elements.getLibraryElement(element);
- if (!enclosingLibrary.equals(identifierEnclosingLibrary)) {
- onError(diagnosticNode, TypeErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, name);
- }
+ if (!Elements.areSameLibrary(currentMethod, element)) {
+ onError(diagnosticNode, TypeErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, name);
}
}
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/Resolver.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698