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

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 964553004: Analyze locals in await for loops as inside a try-finally. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | pkg/compiler/lib/src/ssa/builder.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index fbefe05b7dd83c3f74655b77bef969d9c1c558d7..29588b88a6b8d1b74777d381c82f8369286c31df 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -1028,6 +1028,18 @@ class ClosureTranslator extends Visitor {
node.visitChildren(this);
inTryStatement = oldInTryStatement;
}
+
+ visitForIn(ForIn node) {
+ if (node.awaitToken != null) {
+ // An `await for` loop is enclosed in an implicit try-finally.
+ bool oldInTryStatement = inTryStatement;
+ inTryStatement = true;
+ node.visitChildren(this);
+ inTryStatement = oldInTryStatement;
+ } else {
+ node.visitChildren(this);
+ }
+ }
}
/// A type variable as a local variable.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | pkg/compiler/lib/src/ssa/builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698