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

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

Issue 939773003: - Simplify collection of stack traces. If we determine that a stack (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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/symbols.h ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (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 // 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_;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return func4(); 48 return func4();
49 } 49 }
50 static int func4() { 50 static int func4() {
51 var i = 0; 51 var i = 0;
52 try { 52 try {
53 i = 10; 53 i = 10;
54 func5(); 54 func5();
55 } on ArgumentError catch (e, s) { 55 } on ArgumentError catch (e, s) {
56 i = 200; 56 i = 200;
57 Expect.isNotNull(e.stackTrace, "Errors need a stackTrace on throw"); 57 Expect.isNotNull(e.stackTrace, "Errors need a stackTrace on throw");
58 Expect.isFalse(identical(e.stackTrace, s));
59 Expect.equals(e.stackTrace.toString(), s.toString()); 58 Expect.equals(e.stackTrace.toString(), s.toString());
60 } 59 }
61 return i; 60 return i;
62 } 61 }
63 static List func5() { 62 static List func5() {
64 // Throw an Error. 63 // Throw an Error.
65 throw new ArgumentError("ArgumentError in func5"); 64 throw new ArgumentError("ArgumentError in func5");
66 } 65 }
67 } 66 }
68 67
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 static testMain() { 102 static testMain() {
104 Expect.equals(100, Helper1.func1()); 103 Expect.equals(100, Helper1.func1());
105 Expect.equals(200, Helper2.func1()); 104 Expect.equals(200, Helper2.func1());
106 Expect.equals(300, Helper3.func1()); 105 Expect.equals(300, Helper3.func1());
107 } 106 }
108 } 107 }
109 108
110 main() { 109 main() {
111 ErrorStackTraceTest.testMain(); 110 ErrorStackTraceTest.testMain();
112 } 111 }
OLDNEW
« no previous file with comments | « runtime/vm/symbols.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698