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

Unified Diff: frog/leg/ssa/closure.dart

Issue 9542001: Fix this capturing in closures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 10 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 | « frog/leg/ssa/builder.dart ('k') | frog/tests/leg_only/leg_only.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/closure.dart
diff --git a/frog/leg/ssa/closure.dart b/frog/leg/ssa/closure.dart
index 92948e50589c0ec56debb87302984e518ba4570c..3aefbcd32b9e2e292141c3ee625c48a9cf977dc2 100644
--- a/frog/leg/ssa/closure.dart
+++ b/frog/leg/ssa/closure.dart
@@ -178,8 +178,12 @@ class ClosureTranslator extends AbstractVisitor {
closureData.freeVariableMapping[element] == element);
closureData.freeVariableMapping[element] = element;
} else if (inTryCatchOrFinally) {
- // TODO(ngeoffray): only do this if the variable is mutated.
- closureData.usedVariablesInTry.add(element);
+ // Don't mark the this-element. This would complicate things in the
+ // builder.
+ if (element != closureData.thisElement) {
+ // TODO(ngeoffray): only do this if the variable is mutated.
+ closureData.usedVariablesInTry.add(element);
+ }
}
}
« no previous file with comments | « frog/leg/ssa/builder.dart ('k') | frog/tests/leg_only/leg_only.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698