Chromium Code Reviews| Index: pkg/stack_trace/lib/src/frame.dart |
| =================================================================== |
| --- pkg/stack_trace/lib/src/frame.dart (revision 27787) |
| +++ pkg/stack_trace/lib/src/frame.dart (working copy) |
| @@ -11,7 +11,7 @@ |
| // #1 Foo._bar (file:///home/nweiz/code/stuff.dart:42:21) |
| final _vmFrame = new RegExp( |
| - r'^#\d+\s+([^\s].*) \((.+):(\d+):(\d+)\)$'); |
| + r'^#\d+\s+([^\s].*) \((.+?):(\d+)(?::(\d+))?\)$'); |
| // at VW.call$0 (http://pub.dartlang.org/stuff.dart.js:560:28) |
| // at http://pub.dartlang.org/stuff.dart.js:560:28 |
| @@ -109,9 +109,17 @@ |
| throw new FormatException("Couldn't parse VM stack trace line '$frame'."); |
| } |
| + // Get the pieces out of the regexp match. Function, URI and line should |
| + // always be found. The column is optional. |
| + var member = match[1].replaceAll("<anonymous closure>", "<fn>"); |
| var uri = Uri.parse(match[2]); |
| - var member = match[1].replaceAll("<anonymous closure>", "<fn>"); |
| - return new Frame(uri, int.parse(match[3]), int.parse(match[4]), member); |
| + var line = int.parse(match[3]); |
| + var col = null; |
|
Bob Nystrom
2013/09/24 17:53:56
"col" -> "column".
Ivan Posva
2013/09/24 20:55:11
Done.
|
| + var col_match = match[4]; |
|
Bob Nystrom
2013/09/24 17:53:56
"col_match" -> "columnMatch".
nweiz
2013/09/24 20:16:03
This variable seems superfluous. Just use match[4]
Ivan Posva
2013/09/24 20:55:11
Done.
Ivan Posva
2013/09/24 20:55:11
Every time you access that same array element, you
nweiz
2013/09/24 20:57:11
I care about that a couple orders of magnitude les
|
| + if (col_match != null) { |
| + col = int.parse(col_match); |
| + } |
| + return new Frame(uri, line, col, member); |
| } |
| /// Parses a string representation of a Chrome/V8 stack frame. |