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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10471002: Avoid repeated declaration of the same loop variable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index 44664d94087df2d54bcf4b0b3f45170daf482f32..6465ac096f6201d9ddddbf7a6968bcd97371e406 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -468,9 +468,12 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
declaredVariables.add(variableName);
buffer.add("var ");
}
- } else if (!isGeneratingDeclaration()
- && !isVariableDeclared(variableName)) {
- delayedVariablesDeclaration.add(variableName);
+ } else if (!isVariableDeclared(variableName)) {
+ if (!isGeneratingDeclaration()) {
+ delayedVariablesDeclaration.add(variableName);
+ } else {
+ declaredVariables.add(variableName);
+ }
}
} else if (!isVariableDeclared(variableName)) {
declaredVariables.add(variableName);
« no previous file with comments | « lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698