OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library frame; | 5 library frame; |
6 | 6 |
7 import 'dart:uri'; | 7 import 'dart:uri'; |
8 | 8 |
9 import 'package:pathos/path.dart' as path; | 9 import 'package:pathos/path.dart' as path; |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 /// Parses a string representation of a stack frame. | 79 /// Parses a string representation of a stack frame. |
80 /// | 80 /// |
81 /// [frame] should be formatted in the same way as a native stack trace frame. | 81 /// [frame] should be formatted in the same way as a native stack trace frame. |
82 factory Frame.parse(String frame) { | 82 factory Frame.parse(String frame) { |
83 var match = _nativeFrameRegExp.firstMatch(frame); | 83 var match = _nativeFrameRegExp.firstMatch(frame); |
84 if (match == null) { | 84 if (match == null) { |
85 throw new FormatException("Couldn't parse stack trace line '$frame'."); | 85 throw new FormatException("Couldn't parse stack trace line '$frame'."); |
86 } | 86 } |
87 | 87 |
88 var uri = new Uri.fromString(match[2]); | 88 var uri = Uri.parse(match[2]); |
89 var member = match[1].replaceAll("<anonymous closure>", "<fn>"); | 89 var member = match[1].replaceAll("<anonymous closure>", "<fn>"); |
90 return new Frame(uri, int.parse(match[3]), int.parse(match[4]), member); | 90 return new Frame(uri, int.parse(match[3]), int.parse(match[4]), member); |
91 } | 91 } |
92 | 92 |
93 Frame(this.uri, this.line, this.column, this.member); | 93 Frame(this.uri, this.line, this.column, this.member); |
94 | 94 |
95 String toString() => '$location in $member'; | 95 String toString() => '$location in $member'; |
96 } | 96 } |
OLD | NEW |