| OLD | NEW |
| (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 // Test for dart2js to make sure the computed bailout environment is |
| 6 // correct. |
| 7 |
| 8 var global; |
| 9 |
| 10 class A { |
| 11 var array; |
| 12 |
| 13 foo() { |
| 14 do { |
| 15 var element = global; |
| 16 if (element is Map) continue; |
| 17 if (element is num) break; |
| 18 } while (true); |
| 19 return array[0]; // bailout here. |
| 20 } |
| 21 } |
| 22 |
| 23 void main() { |
| 24 var a = new A(); |
| 25 a.array = [42]; |
| 26 global = 42; |
| 27 |
| 28 for (int i = 0; i < 2; i++) { |
| 29 Expect.equals(42, a.foo()); |
| 30 } |
| 31 |
| 32 a.array = new Map(); |
| 33 a.array[0] = 42; |
| 34 for (int i = 0; i < 2; i++) { |
| 35 Expect.equals(42, a.foo()); |
| 36 } |
| 37 global = null; |
| 38 } |
| OLD | NEW |