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

Unified Diff: lib/src/trace.dart

Issue 1062123003: Support JavaScriptCore stack traces. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Code review changes Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/frame.dart ('k') | pubspec.yaml » ('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 954cf453e9020a87073d513bf134010286d50a7e..bf26c5175b02719a2953da7b4f93be893c4663bf 100644
--- a/lib/src/trace.dart
+++ b/lib/src/trace.dart
@@ -115,6 +115,7 @@ class Trace implements StackTrace {
try {
if (trace.isEmpty) return new Trace(<Frame>[]);
if (trace.contains(_v8Trace)) return new Trace.parseV8(trace);
+ if (trace.startsWith("\tat ")) return new Trace.parseJSCore(trace);
if (trace.contains(_firefoxSafariTrace)) {
return new Trace.parseFirefox(trace);
}
@@ -147,6 +148,10 @@ class Trace implements StackTrace {
.skipWhile((line) => !line.startsWith(_v8TraceLine))
.map((line) => new Frame.parseV8(line)));
+ /// Parses a string representation of a JavaScriptCore stack trace.
+ Trace.parseJSCore(String trace)
+ : this(trace.split("\n").map((line) => new Frame.parseV8(line)));
+
/// Parses a string representation of an Internet Explorer stack trace.
///
/// IE10+ traces look just like V8 traces. Prior to IE10, stack traces can't
« no previous file with comments | « lib/src/frame.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698