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

Unified Diff: lib/src/trace.dart

Issue 1410683011: Make Chain.parse and Trace.parse more similar. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/chain.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/trace.dart
diff --git a/lib/src/trace.dart b/lib/src/trace.dart
index f615cd26abc67852db2cbc323f4007aa916e4318..7f2c662b56e57b6cc10115bffc90a64693c24233 100644
--- a/lib/src/trace.dart
+++ b/lib/src/trace.dart
@@ -111,7 +111,8 @@ class Trace implements StackTrace {
/// Parses a string representation of a stack trace.
///
/// [trace] should be formatted in the same way as a Dart VM or browser stack
- /// trace.
+ /// trace. If it's formatted as a stack chain, this will return the equivalent
+ /// of [Chain.toTrace].
factory Trace.parse(String trace) {
try {
if (trace.isEmpty) return new Trace(<Frame>[]);
@@ -120,6 +121,7 @@ class Trace implements StackTrace {
if (trace.contains(_firefoxSafariTrace)) {
return new Trace.parseFirefox(trace);
}
+ if (trace.contains(chainGap)) return new Chain.parse(trace).toTrace();
if (trace.contains(_friendlyTrace)) {
return new Trace.parseFriendly(trace);
}
« no previous file with comments | « lib/src/chain.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698