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

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

Issue 11051031: Add catchless catch clauses (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class MyException { } 5 class MyException { }
6 6
7 class MyException1 extends MyException { } 7 class MyException1 extends MyException { }
8 8
9 class MyException2 extends MyException { } 9 class MyException2 extends MyException { }
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 var caught = false; 116 var caught = false;
117 try { 117 try {
118 throw new MyException(); 118 throw new MyException();
119 } catch (exc) { 119 } catch (exc) {
120 caught = true; 120 caught = true;
121 } 121 }
122 Expect.equals(true, caught); 122 Expect.equals(true, caught);
123 Expect.equals(3, e); 123 Expect.equals(3, e);
124 } 124 }
125 125
126 static void test9() {
127 var e = 6;
128 try {
129 throw "up";
130 } on String {
131 e = "s";
132 } on int {
133 e = "i";
134 }
135 Expect.equals("s", e);
136 }
137
126 static void testMain() { 138 static void testMain() {
127 test1(); 139 test1();
128 test2(); 140 test2();
129 test3(); 141 test3();
130 test4(); 142 test4();
131 test5(); 143 test5();
132 test6(); 144 test6();
133 test7(); 145 test7();
134 test8(); 146 test8();
147 test9();
135 } 148 }
136 } 149 }
137 150
138 main() { 151 main() {
139 TryCatchTest.testMain(); 152 TryCatchTest.testMain();
140 } 153 }
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698