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

Side by Side Diff: tests/language/external_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/expect_test.dart ('k') | tests/language/f_bounded_quantification_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) 2012, the Dart project authors. Please see the AUTHORS file 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 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 Foo { 5 class Foo {
6 var x; 6 var x;
7 f() {} 7 f() {}
8 8
9 external var x01; /// 01: compile-time error 9 external var x01; /// 01: compile-time error
10 external int x02; /// 02: compile-time error 10 external int x02; /// 02: compile-time error
(...skipping 14 matching lines...) Expand all
25 25
26 external int t06(int i) { } /// 30: compile-time error 26 external int t06(int i) { } /// 30: compile-time error
27 external int t07(int i) => i + 1; /// 31: compile-time error 27 external int t07(int i) => i + 1; /// 31: compile-time error
28 28
29 main() { 29 main() {
30 30
31 // Try calling an unpatched external function. 31 // Try calling an unpatched external function.
32 var foo = new Foo(); /// 10: continued 32 var foo = new Foo(); /// 10: continued
33 try { /// 10: continued 33 try { /// 10: continued
34 foo.f05(); /// 10: continued 34 foo.f05(); /// 10: continued
35 } catch (String exc) { /// 10: continued 35 } on String catch (exc) { /// 10: continued
36 if (exc == "External implementation missing.") { /// 10: continued 36 if (exc == "External implementation missing.") { /// 10: continued
37 throw exc; /// 10: continued 37 throw exc; /// 10: continued
38 } /// 10: continued 38 } /// 10: continued
39 } /// 10: continued 39 } /// 10: continued
40 40
41 try { /// 13: continued 41 try { /// 13: continued
42 Foo.f13(); /// 13: continued 42 Foo.f13(); /// 13: continued
43 } catch (String exc) { /// 13: continued 43 } on String catch (exc) { /// 13: continued
44 if (exc == "External implementation missing.") { /// 13: continued 44 if (exc == "External implementation missing.") { /// 13: continued
45 throw exc; /// 13: continued 45 throw exc; /// 13: continued
46 } /// 13: continued 46 } /// 13: continued
47 } /// 13: continued 47 } /// 13: continued
48 48
49 // Try calling an unpatched external constructor. 49 // Try calling an unpatched external constructor.
50 try { /// 20: continued 50 try { /// 20: continued
51 var foo = new Foo.n09(); /// 20: continued 51 var foo = new Foo.n09(); /// 20: continued
52 } catch (String exc) { /// 20: continued 52 } on String catch (exc) { /// 20: continued
53 if (exc == "External implementation missing.") { /// 20: continued 53 if (exc == "External implementation missing.") { /// 20: continued
54 throw exc; /// 20: continued 54 throw exc; /// 20: continued
55 } /// 20: continued 55 } /// 20: continued
56 } /// 20: continued 56 } /// 20: continued
57 } 57 }
OLDNEW
« no previous file with comments | « tests/language/expect_test.dart ('k') | tests/language/f_bounded_quantification_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698