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

Unified Diff: lib/src/frame.dart

Issue 936643002: Even better stack chains with VM async/await. (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 8ecd19fb1a37e7d3b8a967c77c09b91a16e853aa..c06fd6034f45f898e745129904593356dd4ea6a3 100644
--- a/lib/src/frame.dart
+++ b/lib/src/frame.dart
@@ -57,6 +57,10 @@ final _firefoxSafariFrame = new RegExp(
final _friendlyFrame = new RegExp(
r'^(\S+)(?: (\d+)(?::(\d+))?)?\s+([^\d]\S*)$');
+/// A regular expression that matches asynchronous member names generated by the
+/// VM.
+final _asyncBody = new RegExp(r'<(<anonymous closure>|[^>]+)_async_body>');
+
final _initialDot = new RegExp(r"^\.");
/// A single stack frame. Each frame points to a precise location in Dart code.
@@ -137,7 +141,7 @@ 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>_async_body>", "<async>")
+ .replaceAll(_asyncBody, "<async>")
.replaceAll("<anonymous closure>", "<fn>");
var uri = Uri.parse(match[2]);
« 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