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

Unified Diff: lib/src/frame.dart

Issue 912043002: Better suqpport for async VM frames. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 years, 10 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 | « CHANGELOG.md ('k') | lib/src/vm_trace.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/frame.dart
diff --git a/lib/src/frame.dart b/lib/src/frame.dart
index 4f5b16c2e01c50358fb7ff4af1f0799f8c3ebae5..8ecd19fb1a37e7d3b8a967c77c09b91a16e853aa 100644
--- a/lib/src/frame.dart
+++ b/lib/src/frame.dart
@@ -10,8 +10,9 @@ import 'package:path/path.dart' as path;
import 'trace.dart';
// #1 Foo._bar (file:///home/nweiz/code/stuff.dart:42:21)
-final _vmFrame = new RegExp(
- r'^#\d+\s+(\S.*) \((.+?):(\d+)(?::(\d+))?\)$');
+// #1 Foo._bar (file:///home/nweiz/code/stuff.dart:42)
+// #1 Foo._bar (file:///home/nweiz/code/stuff.dart)
+final _vmFrame = new RegExp(r'^#\d+\s+(\S.*) \((.+?)((?::\d+){0,2})\)$');
// at VW.call$0 (http://pub.dartlang.org/stuff.dart.js:560:28)
// at VW.call$0 (eval as fn
@@ -135,14 +136,14 @@ class 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 member = match[1]
+ .replaceAll("<<anonymous closure>_async_body>", "<async>")
+ .replaceAll("<anonymous closure>", "<fn>");
var uri = Uri.parse(match[2]);
- var line = int.parse(match[3]);
- var column = null;
- var columnMatch = match[4];
- if (columnMatch != null) {
- column = int.parse(columnMatch);
- }
+
+ var lineAndColumn = match[3].split(':');
+ var line = lineAndColumn.length > 1 ? int.parse(lineAndColumn[1]) : null;
+ var column = lineAndColumn.length > 2 ? int.parse(lineAndColumn[2]) : null;
return new Frame(uri, line, column, member);
}
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/vm_trace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698