| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 return new Frame( | 174 return new Frame( |
| 175 _uriOrPathToUri(urlMatch[1]), | 175 _uriOrPathToUri(urlMatch[1]), |
| 176 int.parse(urlMatch[2]), | 176 int.parse(urlMatch[2]), |
| 177 int.parse(urlMatch[3]), | 177 int.parse(urlMatch[3]), |
| 178 member); | 178 member); |
| 179 } | 179 } |
| 180 | 180 |
| 181 // V8 stack frames can be in two forms. | 181 // V8 stack frames can be in two forms. |
| 182 if (match[2] != null) { | 182 if (match[2] != null) { |
| 183 // The first form looks like " at FUNCTION (LOCATION)". | 183 // The first form looks like " at FUNCTION (LOCATION)". V8 proper lists |
| 184 return parseLocation( | 184 // anonymous functions within eval as "<anonymous>", while IE10 lists them |
| 185 match[2], match[1].replaceAll("<anonymous>", "<fn>")); | 185 // as "Anonymous function". |
| 186 return parseLocation(match[2], |
| 187 match[1].replaceAll("<anonymous>", "<fn>") |
| 188 .replaceAll("Anonymous function", "<fn>")); |
| 186 } else { | 189 } else { |
| 187 // The second form looks like " at LOCATION", and is used for anonymous | 190 // The second form looks like " at LOCATION", and is used for anonymous |
| 188 // functions. | 191 // functions. |
| 189 return parseLocation(match[3], "<fn>"); | 192 return parseLocation(match[3], "<fn>"); |
| 190 } | 193 } |
| 191 } | 194 } |
| 192 | 195 |
| 193 /// Parses a string representation of an IE stack frame. | 196 /// Parses a string representation of an IE stack frame. |
| 194 /// | 197 /// |
| 195 /// IE10+ frames look just like V8 frames. Prior to IE10, stack traces can't | 198 /// IE10+ frames look just like V8 frames. Prior to IE10, stack traces can't |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // their stack frames. However, if we do get a relative path, we should | 282 // their stack frames. However, if we do get a relative path, we should |
| 280 // handle it gracefully. | 283 // handle it gracefully. |
| 281 if (uriOrPath.contains('\\')) return path.windows.toUri(uriOrPath); | 284 if (uriOrPath.contains('\\')) return path.windows.toUri(uriOrPath); |
| 282 return Uri.parse(uriOrPath); | 285 return Uri.parse(uriOrPath); |
| 283 } | 286 } |
| 284 | 287 |
| 285 Frame(this.uri, this.line, this.column, this.member); | 288 Frame(this.uri, this.line, this.column, this.member); |
| 286 | 289 |
| 287 String toString() => '$location in $member'; | 290 String toString() => '$location in $member'; |
| 288 } | 291 } |
| OLD | NEW |