| 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 | 7 |
| 8 import 'package:path/path.dart' as path; | 8 import 'package:path/path.dart' as path; |
| 9 | 9 |
| 10 import 'trace.dart'; | 10 import 'trace.dart'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 var match = _vmFrame.firstMatch(frame); | 112 var match = _vmFrame.firstMatch(frame); |
| 113 if (match == null) { | 113 if (match == null) { |
| 114 throw new FormatException("Couldn't parse VM stack trace line '$frame'."); | 114 throw new FormatException("Couldn't parse VM stack trace line '$frame'."); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // Get the pieces out of the regexp match. Function, URI and line should | 117 // Get the pieces out of the regexp match. Function, URI and line should |
| 118 // always be found. The column is optional. | 118 // always be found. The column is optional. |
| 119 var member = match[1].replaceAll("<anonymous closure>", "<fn>"); | 119 var member = match[1].replaceAll("<anonymous closure>", "<fn>"); |
| 120 var uri = Uri.parse(match[2]); | 120 var uri = Uri.parse(match[2]); |
| 121 // Work around issue 11901. |
| 122 if (uri == new Uri(path: 'timer_impl.dart')) { |
| 123 uri = Uri.parse('dart:async/timer_impl.dart'); |
| 124 } |
| 121 var line = int.parse(match[3]); | 125 var line = int.parse(match[3]); |
| 122 var column = null; | 126 var column = null; |
| 123 var columnMatch = match[4]; | 127 var columnMatch = match[4]; |
| 124 if (columnMatch != null) { | 128 if (columnMatch != null) { |
| 125 column = int.parse(columnMatch); | 129 column = int.parse(columnMatch); |
| 126 } | 130 } |
| 127 return new Frame(uri, line, column, member); | 131 return new Frame(uri, line, column, member); |
| 128 } | 132 } |
| 129 | 133 |
| 130 /// Parses a string representation of a Chrome/V8 stack frame. | 134 /// Parses a string representation of a Chrome/V8 stack frame. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // their stack frames. However, if we do get a relative path, we should | 244 // their stack frames. However, if we do get a relative path, we should |
| 241 // handle it gracefully. | 245 // handle it gracefully. |
| 242 if (uriOrPath.contains('\\')) return path.windows.toUri(uriOrPath); | 246 if (uriOrPath.contains('\\')) return path.windows.toUri(uriOrPath); |
| 243 return Uri.parse(uriOrPath); | 247 return Uri.parse(uriOrPath); |
| 244 } | 248 } |
| 245 | 249 |
| 246 Frame(this.uri, this.line, this.column, this.member); | 250 Frame(this.uri, this.line, this.column, this.member); |
| 247 | 251 |
| 248 String toString() => '$location in $member'; | 252 String toString() => '$location in $member'; |
| 249 } | 253 } |
| OLD | NEW |