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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/switch_try_catch_test.dart
===================================================================
--- tests/language/switch_try_catch_test.dart (revision 0)
+++ tests/language/switch_try_catch_test.dart (revision 0)
@@ -0,0 +1,33 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for issue 18869: Check that try-catch is working correctly
+// inside switch-case clauses.
+
+
+import "package:expect/expect.dart";
+
+test_switch() {
+ switch(0) {
+ _0: case 0:
+ print("_0");
+ continue _5;
+ _1: case 1:
+ try {
+ print("bunny");
+ continue _6;
+ } catch(e) { }
+ break;
+ _5: case 5:
+ print("_5");
+ continue _6;
+ _6: case 6:
+ print("_6");
+ throw 555;
+ }
+}
+
+main() {
+ Expect.throws(() => test_switch(), (e) => e == 555);
+}
« 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