Chromium Code Reviews| Index: lib/src/trace.dart |
| diff --git a/lib/src/trace.dart b/lib/src/trace.dart |
| index 954cf453e9020a87073d513bf134010286d50a7e..e7462574d9bfc2d390e93b4201dba7e71dc68c22 100644 |
| --- a/lib/src/trace.dart |
| +++ b/lib/src/trace.dart |
| @@ -13,6 +13,8 @@ import 'lazy_trace.dart'; |
| import 'utils.dart'; |
| import 'vm_trace.dart'; |
| +import 'dart:convert'; |
| + |
| final _terseRegExp = new RegExp(r"(-patch)?(/.*)?$"); |
| /// A RegExp to match V8's stack traces. |
| @@ -115,6 +117,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); |
| } |
| @@ -127,6 +130,7 @@ class Trace implements StackTrace { |
| // 11257). |
| return new Trace.parseVM(trace); |
| } on FormatException catch (error) { |
| + print(JSON.encode(trace)); |
|
kevmoo
2015/04/13 23:25:47
Oops?
nweiz
2015/04/13 23:27:19
Done.
|
| throw new FormatException('${error.message}\nStack trace:\n$trace'); |
| } |
| } |
| @@ -147,6 +151,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 |