Enable parsing of IPv6 form addresse (see rfc2373 and rfc2732). This also wraps the 'domain' component in toString with [...], if it contains any ':' characters. BUG= R=floitsch@google.com, sgjesse@google.com Review URL: https://codereview.chromium.org//14753005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/stack_trace@22228 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkgs/stack_trace/lib/src/frame.dart b/pkgs/stack_trace/lib/src/frame.dart index f05b469..cb7d656 100644 --- a/pkgs/stack_trace/lib/src/frame.dart +++ b/pkgs/stack_trace/lib/src/frame.dart
@@ -85,7 +85,7 @@ throw new FormatException("Couldn't parse stack trace line '$frame'."); } - var uri = new Uri.fromString(match[2]); + 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); }
diff --git a/pkgs/stack_trace/test/frame_test.dart b/pkgs/stack_trace/test/frame_test.dart index 02bec68..826bad7 100644 --- a/pkgs/stack_trace/test/frame_test.dart +++ b/pkgs/stack_trace/test/frame_test.dart
@@ -31,8 +31,7 @@ test('parses a stack frame correctly', () { var frame = new Frame.parse("#1 Foo._bar " "(file:///home/nweiz/code/stuff.dart:42:21)"); - expect(frame.uri, - equals(new Uri.fromString("file:///home/nweiz/code/stuff.dart"))); + expect(frame.uri, equals(Uri.parse("file:///home/nweiz/code/stuff.dart"))); expect(frame.line, equals(42)); expect(frame.column, equals(21)); expect(frame.member, equals('Foo._bar'));
diff --git a/pkgs/stack_trace/test/trace_test.dart b/pkgs/stack_trace/test/trace_test.dart index cbbf90b..d3fa56e 100644 --- a/pkgs/stack_trace/test/trace_test.dart +++ b/pkgs/stack_trace/test/trace_test.dart
@@ -41,10 +41,10 @@ '''); expect(trace.frames[0].uri, - equals(new Uri.fromString("file:///home/nweiz/code/stuff.dart"))); - expect(trace.frames[1].uri, equals(new Uri.fromString("dart:async"))); + equals(Uri.parse("file:///home/nweiz/code/stuff.dart"))); + expect(trace.frames[1].uri, equals(Uri.parse("dart:async"))); expect(trace.frames[2].uri, - equals(new Uri.fromString("http://pub.dartlang.org/thing.dart"))); + equals(Uri.parse("http://pub.dartlang.org/thing.dart"))); }); test('parses a real stack trace correctly', () {