Index: lib/src/frame.dart |
diff --git a/lib/src/frame.dart b/lib/src/frame.dart |
index 8dde788a734919c831bcc0338bcb89c7e418ae85..8599245498168f2b8b2ccd9270a7cd1f8ca6ef32 100644 |
--- a/lib/src/frame.dart |
+++ b/lib/src/frame.dart |
@@ -52,9 +52,11 @@ final _firefoxSafariFrame = new RegExp( |
r'$'); |
// foo/bar.dart 10:11 Foo._bar |
+// foo/bar.dart 10:11 (anonymous function).dart.fn |
// http://dartlang.org/foo/bar.dart Foo._bar |
+// data:... 10:11 Foo._bar |
final _friendlyFrame = new RegExp( |
- r'^(\S+)(?: (\d+)(?::(\d+))?)?\s+([^\d]\S*)$'); |
+ r'^(\S+)(?: (\d+)(?::(\d+))?)?\s+([^\d].*)$'); |
/// A regular expression that matches asynchronous member names generated by the |
/// VM. |
@@ -186,7 +188,8 @@ class Frame { |
// as "Anonymous function". |
return parseLocation(match[2], |
match[1].replaceAll("<anonymous>", "<fn>") |
- .replaceAll("Anonymous function", "<fn>")); |
+ .replaceAll("Anonymous function", "<fn>") |
+ .replaceAll("(anonymous function)", "<fn>")); |
} else { |
// The second form looks like " at LOCATION", and is used for anonymous |
// functions. |
@@ -249,8 +252,11 @@ class Frame { |
throw new FormatException( |
"Couldn't parse package:stack_trace stack trace line '$frame'."); |
} |
- |
- var uri = Uri.parse(match[1]); |
+ // Fake truncated data urls generated by the friendly stack trace format |
+ // cause Uri.parse to throw an exception so we have to special case them. |
+ var uri = match[1] == 'data:...' |
+ ? new Uri.dataFromString('') |
+ : Uri.parse(match[1]); |
// If there's no scheme, this is a relative URI. We should interpret it as |
// relative to the current working directory. |
if (uri.scheme == '') { |