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

Unified Diff: lib/src/frame.dart

Issue 2739643004: Fix friendly frame parsing bugs. (Closed)
Patch Set: Created 3 years, 9 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
Index: lib/src/frame.dart
diff --git a/lib/src/frame.dart b/lib/src/frame.dart
index 8dde788a734919c831bcc0338bcb89c7e418ae85..08fe33e7113d4d7c9cb4ea338ae1523f9334a4a3 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.
@@ -249,8 +251,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('...')
nweiz 2017/03/07 21:27:28 Maybe just pass this an empty string. I think that
Jacob 2017/03/07 23:27:20 Done.
+ : 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 == '') {

Powered by Google App Engine
This is Rietveld 408576698