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

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

Issue 10914215: Issue 5049. Consistently resolve instance/static/top-level property access (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/Resolver.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/Elements.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Elements.java b/compiler/java/com/google/dart/compiler/resolver/Elements.java
index a1489db4597bff2b6ff584eeb425fbe3e660b09b..be74a38fde9e893394bcd8feea939d97d4e370d8 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Elements.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Elements.java
@@ -28,6 +28,7 @@ import com.google.dart.compiler.ast.DartParameter;
import com.google.dart.compiler.ast.DartSuperExpression;
import com.google.dart.compiler.ast.DartTypeNode;
import com.google.dart.compiler.ast.DartTypeParameter;
+import com.google.dart.compiler.ast.DartUnaryExpression;
import com.google.dart.compiler.ast.DartVariable;
import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.ast.Modifiers;
@@ -779,6 +780,12 @@ static FieldElementImplementation fieldFromNode(DartField node,
* expression. Other types of assignments also read the value and require a getter access.
*/
public static boolean inSetterContext(DartNode node) {
+ if (node.getParent() instanceof DartUnaryExpression) {
+ DartUnaryExpression expr = (DartUnaryExpression) node.getParent();
+ if (expr.getArg() == node && expr.getOperator().isCountOperator()) {
+ return true;
+ }
+ }
if (node.getParent() instanceof DartBinaryExpression) {
DartBinaryExpression expr = (DartBinaryExpression) node.getParent();
if (ASSIGN_OPERATORS.contains(expr.getOperator()) && expr.getArg1() == node) {
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Resolver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698