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

Side by Side Diff: tests/language/rewrite_for_update_order_test.dart

Issue 318723002: dart2dart: Restore loops with conditions and updates in backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test cases Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 var counter = 0;
7 var global = 0; 8 var global = 0;
8 9
9 bar() { 10 test() {
10 global += 1; 11 ++counter;
11 } 12 return counter <= 2;
12 baz() {
13 global += 100;
14 } 13 }
15 14
16 foo(b) { 15 first() {
17 var old_backend_was_used; 16 global = global + 1;
18 if (b ? false : true) { 17 }
19 bar(); 18 second() {
20 bar(); 19 global = global * 2;
21 } else { 20 }
22 baz(); 21
23 baz(); 22 foo() {
23 while (test()) {
24 first();
25 second();
24 } 26 }
25 } 27 }
26 28
27 main() { 29 main() {
28 foo(true); 30 foo();
29 Expect.equals(200, global); 31 Expect.equals(6, global);
30
31 foo(false);
32 Expect.equals(202, global);
33 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698