| 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 be confused when inlining | 5 // Regression test for dart2js that used to be confused when inlining |
| 6 // method that always aborts in a switch case. | 6 // method that always aborts in a switch case. |
| 7 | 7 |
| 8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
| 9 | 9 |
| 10 foo() { | 10 foo() { |
| 11 throw 42; | 11 throw 42; |
| 12 } | 12 } |
| 13 | 13 |
| 14 main() { | 14 main() { |
| 15 var exception; | 15 var exception; |
| 16 try { | 16 try { |
| 17 switch (42) { | 17 switch (42) { |
| 18 case 42: | 18 case 42: |
| 19 foo(); | 19 foo(); |
| 20 foo(); | 20 foo(); |
| 21 break; | 21 break; |
| 22 } | 22 } |
| 23 } catch (e) { | 23 } catch (e) { |
| 24 exception = e; | 24 exception = e; |
| 25 } | 25 } |
| 26 Expect.equals(42, exception); | 26 Expect.equals(42, exception); |
| 27 } | 27 } |
| OLD | NEW |