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

Unified Diff: pkg/analyzer2dart/test/end2end_data.dart

Issue 702453002: Support for-in in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. 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 | « pkg/analyzer2dart/lib/src/cps_generator.dart ('k') | pkg/analyzer2dart/test/sexpr_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/test/end2end_data.dart
diff --git a/pkg/analyzer2dart/test/end2end_data.dart b/pkg/analyzer2dart/test/end2end_data.dart
index 572f294276fe27e0b952d23ac8ffb557050042ab..99fb7fff4f069f73d83bda08a6f2e45f2aeaf6b7 100644
--- a/pkg/analyzer2dart/test/end2end_data.dart
+++ b/pkg/analyzer2dart/test/end2end_data.dart
@@ -645,4 +645,59 @@ main() {
}
}'''),
]),
+
+ const Group('For in loop', const <TestSpec>[
+// TODO(johnniwinther): Add tests for `i` as top-level, static and instance
+// fields.
+ const TestSpec('''
+main(a) {
+ for (var i in a) {
+ print(i);
+ }
+}
+''', '''
+main(a) {
+ var v0 = a.iterator;
+ while (v0.moveNext()) {
+ print(v0.current);
+ }
+}'''),
+
+ const TestSpec('''
+main(a) {
+ for (var i in a) {
+ print(i);
+ i = 0;
+ print(i);
+ }
+}
+''', '''
+main(a) {
+ var v0 = a.iterator, i;
+ while (v0.moveNext()) {
+ i = v0.current;
+ print(i);
+ i = 0;
+ print(i);
+ }
+}
+'''),
+
+ const TestSpec('''
+main(a) {
+ var i;
+ for (i in a) {
+ print(i);
+ }
+}
+''', '''
+main(a) {
+ var i, v0 = a.iterator;
+ while (v0.moveNext()) {
+ i = v0.current;
+ print(i);
+ }
+}
+'''),
+ ]),
];
« no previous file with comments | « pkg/analyzer2dart/lib/src/cps_generator.dart ('k') | pkg/analyzer2dart/test/sexpr_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698