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

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

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 3 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 | « tests/language/try_catch2_test.dart ('k') | tests/language/try_catch_syntax_test.dart » ('j') | 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
11 class TryCatchTest { 11 class TryCatchTest {
12 static void test1() { 12 static void test1() {
13 var foo = 0; 13 var foo = 0;
14 try { 14 try {
15 throw new MyException1(); 15 throw new MyException1();
16 } 16 }
17 on MyException3 catch (e) { } /// 01: compile-time error 17 on MyException3 catch (e) { } /// 01: compile-time error
18 on on MyException2 catch (e) { } /// 02: compile-time error 18 on on MyException2 catch (e) { } /// 02: compile-time error
19 catch MyException2 catch (e) { } /// 03: compile-time error 19 catch MyException2 catch (e) { } /// 03: compile-time error
20 catch catch catch (e) { } /// 04: compile-time error 20 catch catch catch (e) { } /// 04: compile-time error
21 on (e) { } /// 05: compile-time error 21 on (e) { } /// 05: compile-time error
22 catch MyException2 catch (e) { } /// 06: compile-time error 22 catch MyException2 catch (e) { } /// 06: compile-time error
23 on MyException2 catch (e) { 23 on MyException2 catch (e) {
24 foo = 1; 24 foo = 1;
25 } on MyException1 catch (e) { 25 } on MyException1 catch (e) {
26 foo = 2; 26 foo = 2;
27 } on MyException catch (e) { 27 } on MyException catch (e) {
28 foo = 3; 28 foo = 3;
29 } 29 }
30 Expect.equals(2, foo); 30 Expect.equals(2, foo);
31 } 31 }
32 32
33 static void testMain() { 33 static void testMain() {
34 test1(); 34 test1();
35 } 35 }
36 } 36 }
37 37
38 main() { 38 main() {
39 TryCatchTest.testMain(); 39 TryCatchTest.testMain();
40 } 40 }
OLDNEW
« no previous file with comments | « tests/language/try_catch2_test.dart ('k') | tests/language/try_catch_syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698