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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 737793004: Fix declaration of locals in the cps js codegen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make the set local Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index baad66255e78d7c1865aeee42f85975d768eecb8..835e23a03b5cd8f0541232d063b3e6900715369d 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -51,14 +51,19 @@ class CodeGenerator extends tree_ir.Visitor<dynamic, js.Expression> {
void buildFunction(tree_ir.FunctionDefinition function) {
currentFunction = function.element;
visitStatement(function.body);
+
+ Set<tree_ir.Variable> parameterSet = new Set<tree_ir.Variable>();
+
for (tree_ir.Variable parameter in function.parameters) {
String name = getVariableName(parameter);
parameters.add(new js.Parameter(name));
+ parameterSet.add(parameter);
}
List<js.VariableInitialization> jsVariables = <js.VariableInitialization>[];
for (tree_ir.Variable variable in variableNames.keys) {
+ if (parameterSet.contains(variable)) continue;
String name = getVariableName(variable);
js.VariableInitialization jsVariable = new js.VariableInitialization(
new js.VariableDeclaration(name),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698