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

Side by Side Diff: tests/language_strong/bailout7_test.dart

Issue 2990933002: Migrate block 43. (Closed)
Patch Set: Update tests and status file. Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "package:expect/expect.dart";
6
7 // Test to make sure the do/while loop exit condition is generated.
8
9 var global;
10
11 class A {
12 var array;
13
14 initArray() {
15 if (global[0] == null) {
16 return [2];
17 } else {
18 var map = new Map();
19 map[0] = 2;
20 return map;
21 }
22 }
23
24 bar() {
25 array = initArray();
26 var element;
27 do {
28 element = array[0]; // bailout here
29 if (element is Map) continue;
30 if (element == null) break;
31 } while (element != 2);
32 return global[0]; // bailout here
33 }
34 }
35
36 void main() {
37 global = [2];
38 for (int i = 0; i < 2; i++) {
39 Expect.equals(2, new A().bar());
40 }
41
42 global = new Map();
43 global[0] = 2;
44 for (int i = 0; i < 2; i++) {
45 Expect.equals(2, new A().bar());
46 }
47 }
OLDNEW
« no previous file with comments | « tests/language_strong/bailout6_test.dart ('k') | tests/language_strong/bailout_container_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698