| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, 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 switcher(val) { |
| 6 var x = 0; |
| 7 switch (val) { |
| 8 case 1: |
| 9 x = 100; |
| 10 break; |
| 11 case 2: |
| 12 x = 200; |
| 13 break; |
| 14 case 3: |
| 15 x = 300; |
| 16 break; |
| 17 default: |
| 18 return 400; |
| 19 break; // Intentional dead code (regression test for crash). |
| 20 } |
| 21 return x; |
| 22 } |
| 23 |
| 24 main() { |
| 25 Expect.equals(100, switcher(1)); |
| 26 Expect.equals(200, switcher(2)); |
| 27 Expect.equals(300, switcher(3)); |
| 28 Expect.equals(400, switcher(4)); |
| 29 } |
| OLD | NEW |