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

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

Issue 10578047: Revert "More support of library privacy for analyzer" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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/java/com/google/dart/compiler/resolver/ResolverErrorCode.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/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 ec641c30bda1c930aea66cea3a1959557dee2336..2cf871c3a6dfe46429419bb9d0f9838c49c3744f 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1117,10 +1117,6 @@ public class Resolver {
case CLASS:
// Must be a static field.
element = Elements.findElement(((ClassElement) qualifier), x.getPropertyName());
- if (isIllegalPrivateAccess(x.getName(), qualifier, element, x.getPropertyName())) {
- // break;
- return null;
- }
switch (ElementKind.of(element)) {
case FIELD:
FieldElement field = (FieldElement) element;
@@ -1161,9 +1157,6 @@ public class Resolver {
break;
case SUPER:
- if (isIllegalPrivateAccess(x.getName(), qualifier, element, x.getPropertyName())) {
- return null;
- }
ClassElement cls = ((SuperElement) qualifier).getClassElement();
Member member = cls.getType().lookupMember(x.getPropertyName());
if (member != null) {
@@ -1228,24 +1221,6 @@ public class Resolver {
return recordElement(x, element);
}
- private boolean isIllegalPrivateAccess(DartNode diagnosticNode, Element qualifier,
- Element element, String name) {
- if (DartIdentifier.isPrivateName(name)) {
- 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;
- }
- }
- }
- return false;
- }
-
private Element resolveQualifier(DartNode qualifier) {
return (qualifier instanceof DartIdentifier)
? resolveIdentifier((DartIdentifier) qualifier, true)
@@ -1268,11 +1243,6 @@ public class Resolver {
}
if (element == null || !element.getModifiers().isStatic()) {
diagnoseErrorInMethodInvocation(x, classElement, element);
- } else {
- if (isIllegalPrivateAccess(x.getFunctionName(), target, element,
- x.getFunctionNameString())) {
- break;
- }
}
break;
}
@@ -1383,18 +1353,6 @@ public class Resolver {
element = new SyntheticDefaultConstructorElement(null, classElement, typeProvider);
}
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)) {
- onError(x.getConstructor(), ResolverErrorCode.ILLEGAL_ACCESS_TO_PRIVATE,
- element.getName());
- return null;
- }
- }
- break;
case TYPE_VARIABLE:
onError(x.getConstructor(), ResolverErrorCode.NEW_EXPRESSION_CANT_USE_TYPE_VAR);
return null;
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698