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

Side by Side Diff: tests/language/switch_try_catch_test.dart

Issue 308053012: Fix try-catch and continue in switch statements. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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 // Regression test for issue 18869: Check that try-catch is working correctly
6 // inside switch-case clauses.
7
8
9 import "package:expect/expect.dart";
10
11 test_switch() {
12 switch(0) {
13 _0: case 0:
14 print("_0");
15 continue _5;
16 _1: case 1:
17 try {
18 print("bunny");
19 continue _6;
20 } catch(e) { }
21 break;
22 _5: case 5:
23 print("_5");
24 continue _6;
25 _6: case 6:
26 print("_6");
27 throw 555;
28 }
29 }
30
31 main() {
32 Expect.throws(() => test_switch(), (e) => e == 555);
33 }
OLDNEW
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698