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

Unified Diff: tests/language/for_test.dart

Issue 459763003: dart2dart: Fix a scoping bug in the translation of loops. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 6 years, 4 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: tests/language/for_test.dart
diff --git a/tests/language/for_test.dart b/tests/language/for_test.dart
index 96773998d0144803d76576db0cca8ceb1a579759..a9560e910ed8fc100b8a2e0aced7235ed221a4b2 100644
--- a/tests/language/for_test.dart
+++ b/tests/language/for_test.dart
@@ -45,6 +45,13 @@ class Helper {
}
status = 1;
}
+
+ static int f6() {
+ // Verify that side effects in the condition are visible after the loop.
+ int i = 0;
+ for (; ++i < 3; ) {}
+ return i;
+ }
}
class ForTest {
@@ -67,6 +74,8 @@ class ForTest {
Helper.f5();
Expect.equals(1, Helper.status);
+
+ Expect.equals(3, Helper.f6());
}
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart ('k') | tests/language/while_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698