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

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

Issue 14009004: Remove methods on StackTrace class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add dart2j issue number for unexepected stack trace. Created 7 years, 8 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/language_dart2js.status ('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 // Dart test program for testing throw statement 4 // Dart test program for testing throw statement
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 class MyException { 8 class MyException {
9 const MyException(String message) : message_ = message; 9 const MyException(String message) : message_ = message;
10 final String message_; 10 final String message_;
11 } 11 }
12 12
13 class Helper { 13 class Helper {
14 static int f1(int i) { 14 static int f1(int i) {
15 try { 15 try {
16 i = func(); 16 i = func();
17 i = 10; 17 i = 10;
18 } on MyException catch (exception, stacktrace) { 18 } on MyException catch (exception, stacktrace) {
19 i = 50; 19 i = 50;
20 print(exception.message_); 20 print(exception.message_);
21 Expect.equals((stacktrace != null), true); 21 Expect.isNotNull(stacktrace);
22 print(stacktrace); 22 print(stacktrace);
23 } 23 }
24 try { 24 try {
25 int j; 25 int j;
26 i = func1(); 26 i = func1();
27 i = 200; 27 i = 200;
28 } on MyException catch (exception, stacktrace) { 28 } on MyException catch (exception, stacktrace) {
29 i = 50; 29 i = 50;
30 print(exception.message_); 30 print(exception.message_);
31 Expect.equals((stacktrace != null), true); 31 Expect.isNotNull(stacktrace);
32 print(stacktrace); 32 print(stacktrace);
33 } 33 }
34 try { 34 try {
35 int j; 35 int j;
36 i = func2(); 36 i = func2();
37 i = 200; 37 i = 200;
38 } on MyException catch (exception, stacktrace) { 38 } on MyException catch (exception, stacktrace) {
39 i = 50; 39 i = 50;
40 print(exception.message_); 40 print(exception.message_);
41 Expect.equals((stacktrace != null), true); 41 Expect.isNotNull(stacktrace);
42 print(stacktrace); 42 print(stacktrace);
43 } finally { 43 } finally {
44 i = i + 800; 44 i = i + 800;
45 } 45 }
46 return i; 46 return i;
47 } 47 }
48 48
49 static int func() { 49 static int func() {
50 int i = 0; 50 int i = 0;
51 while (i < 10) { 51 while (i < 10) {
(...skipping 27 matching lines...) Expand all
79 79
80 class StackTraceTest { 80 class StackTraceTest {
81 static testMain() { 81 static testMain() {
82 Expect.equals(850, Helper.f1(1)); 82 Expect.equals(850, Helper.f1(1));
83 } 83 }
84 } 84 }
85 85
86 main() { 86 main() {
87 StackTraceTest.testMain(); 87 StackTraceTest.testMain();
88 } 88 }
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698