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

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

Issue 22557002: Fix uses of throw/rethrow. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/isolate/global_error_handler_test.dart ('k') | tests/language/language_analyzer.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // (c) 2013, 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 void func1() { 7 void func1() {
8 throw new Exception("Test full stacktrace"); 8 throw new Exception("Test full stacktrace");
9 } 9 }
10 void func2() { 10 void func2() {
11 func1(); 11 func1();
12 } 12 }
13 void func3() { 13 void func3() {
14 try { 14 try {
15 func2(); 15 func2();
16 } on Object catch(e, s) { 16 } on Object catch(e, s) {
17 var fullTrace = s.toString(); 17 var fullTrace = s.toString();
18 Expect.isTrue(fullTrace.contains("func1")); 18 Expect.isTrue(fullTrace.contains("func1"));
19 Expect.isTrue(fullTrace.contains("func2")); 19 Expect.isTrue(fullTrace.contains("func2"));
20 Expect.isTrue(fullTrace.contains("func3")); 20 Expect.isTrue(fullTrace.contains("func3"));
21 Expect.isTrue(fullTrace.contains("func4")); 21 Expect.isTrue(fullTrace.contains("func4"));
22 Expect.isTrue(fullTrace.contains("func5")); 22 Expect.isTrue(fullTrace.contains("func5"));
23 Expect.isTrue(fullTrace.contains("func6")); 23 Expect.isTrue(fullTrace.contains("func6"));
24 Expect.isTrue(fullTrace.contains("func7")); 24 Expect.isTrue(fullTrace.contains("func7"));
25 Expect.isTrue(fullTrace.contains("main")); 25 Expect.isTrue(fullTrace.contains("main"));
26 26
27 throw; // This is a rethrow. 27 rethrow; // This is a rethrow.
28 } 28 }
29 } 29 }
30 int func4() { 30 int func4() {
31 func3(); 31 func3();
32 return 1; 32 return 1;
33 } 33 }
34 int func5() { 34 int func5() {
35 try { 35 try {
36 func4(); 36 func4();
37 } on Object catch(e, s) { 37 } on Object catch(e, s) {
(...skipping 14 matching lines...) Expand all
52 return 1; 52 return 1;
53 } 53 }
54 int func7() { 54 int func7() {
55 func6(); 55 func6();
56 return 1; 56 return 1;
57 } 57 }
58 main() { 58 main() {
59 var i = func7(); 59 var i = func7();
60 Expect.equals(1, i); 60 Expect.equals(1, i);
61 } 61 }
OLDNEW
« no previous file with comments | « tests/isolate/global_error_handler_test.dart ('k') | tests/language/language_analyzer.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698