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

Unified Diff: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java

Issue 16337007: Version 0.5.13.1 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 7 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
Index: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java
===================================================================
--- editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java (revision 23549)
+++ editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/Context.java (working copy)
@@ -29,6 +29,7 @@
import com.google.dart.engine.ast.ConstructorDeclaration;
import com.google.dart.engine.ast.Expression;
import com.google.dart.engine.ast.FieldDeclaration;
+import com.google.dart.engine.ast.ForEachStatement;
import com.google.dart.engine.ast.FormalParameter;
import com.google.dart.engine.ast.FormalParameterList;
import com.google.dart.engine.ast.Identifier;
@@ -251,6 +252,19 @@
}
@Override
+ public Void visitForEachStatement(ForEachStatement node) {
+ SimpleIdentifier nameNode = node.getLoopVariable().getIdentifier();
+ String variableName = nameNode.getName();
+ if (forbiddenNames.contains(variableName)) {
+ ensureHierarchyNames(node);
+ ensureMethodNames(node);
+ String newName = generateUniqueVariableName(variableName);
+ renameIdentifier(nameNode, newName);
+ }
+ return super.visitForEachStatement(node);
+ }
+
+ @Override
public Void visitMethodDeclaration(MethodDeclaration node) {
methodNames = null;
try {

Powered by Google App Engine
This is Rietveld 408576698