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

Side by Side Diff: tool/input_sdk/lib/core/stacktrace.dart

Issue 1967383002: Upgrade StackTrace to the latest SDK version. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « test/browser/language_tests.js ('k') | tool/sdk_expected_errors.txt » ('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) 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 4
5 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * An interface implemented by all stack trace objects. 8 * An interface implemented by all stack trace objects.
9 * 9 *
10 * A [StackTrace] is intended to convey information to the user about the call 10 * A [StackTrace] is intended to convey information to the user about the call
11 * sequence that triggered an exception. 11 * sequence that triggered an exception.
12 * 12 *
13 * These objects are created by the runtime, it is not possible to create 13 * These objects are created by the runtime, it is not possible to create
14 * them programmatically. 14 * them programmatically.
15 */ 15 */
16 abstract class StackTrace { 16 abstract class StackTrace {
17 StackTrace(); // In case existing classes extend StackTrace.
18
19 /**
20 * Create a `StackTrace` object from [stackTraceString].
21 *
22 * The created stack trace will have a `toString` method returning
23 * `stackTraceString`.
24 *
25 * The `stackTraceString` can be a string returned by some other
26 * stack trace, or it can be any string at all.
27 * If the string doesn't look like a stack trace, code that interprets
28 * stack traces is likely to fail, so fake stack traces should be used
29 * with care.
30 */
31 factory StackTrace.fromString(String stackTraceString) = _StringStackTrace;
32
17 /** 33 /**
18 * Returns a representation of the current stack trace. 34 * Returns a representation of the current stack trace.
19 * 35 *
20 * This is similar to what can be achieved by doing: 36 * This is similar to what can be achieved by doing:
21 * 37 *
22 * try { throw 0; } catch (_, stack) { return stack; } 38 * try { throw 0; } catch (_, stack) { return stack; }
23 * 39 *
24 * The getter achieves this without throwing, except on platforms that 40 * The getter achieves this without throwing, except on platforms that
25 * have no other way to get a stack trace. 41 * have no other way to get a stack trace.
26 */ 42 */
27 external static StackTrace get current; 43 external static StackTrace get current;
28 44
29 /** 45 /**
30 * Returns a [String] representation of the stack trace. 46 * Returns a [String] representation of the stack trace.
31 * 47 *
32 * The string represents the full stack trace starting from 48 * The string represents the full stack trace starting from
33 * the point where a throw ocurred to the top of the current call sequence. 49 * the point where a throw ocurred to the top of the current call sequence.
34 * 50 *
35 * The exact format of the string representation is not final. 51 * The exact format of the string representation is not final.
36 */ 52 */
37 String toString(); 53 String toString();
38 } 54 }
39 55
56 class _StringStackTrace implements StackTrace {
57 final String _stackTrace;
58 _StringStackTrace(this._stackTrace);
59 String toString() => _stackTrace;
60 }
OLDNEW
« no previous file with comments | « test/browser/language_tests.js ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698