| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Regression test for dart2js that used to generate wrong code for | 5 // Regression test for dart2js that used to generate wrong code for |
| 6 // it. The bug happened in the SSA type propagation. | 6 // it. The bug happened in the SSA type propagation. |
| 7 | 7 |
| 8 class A { | 8 class A { |
| 9 next() => new B(); | 9 next() => new B(); |
| 10 doIt() => null; | 10 doIt() => null; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 main() { | 40 main() { |
| 41 var a = new A(); | 41 var a = new A(); |
| 42 for (var i in [42]) { | 42 for (var i in [42]) { |
| 43 a = a.next(); | 43 a = a.next(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // (1, 5) | 46 // (1, 5) |
| 47 | 47 |
| 48 var b = a; | 48 var b = a; |
| 49 while (b.isEmpty) { // (4, 6) | 49 while (b.isEmpty) { |
| 50 // (4, 6) |
| 50 b.foo(); // (3, 7) | 51 b.foo(); // (3, 7) |
| 51 b.bar(); // (8) | 52 b.bar(); // (8) |
| 52 b = b.doIt(); // (2) | 53 b = b.doIt(); // (2) |
| 53 } | 54 } |
| 54 | 55 |
| 55 if (!entered) throw 'Test failed'; | 56 if (!entered) throw 'Test failed'; |
| 56 } | 57 } |
| OLD | NEW |