| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return parseLocation(match[2], | 188 return parseLocation(match[2], |
| 189 match[1].replaceAll("<anonymous>", "<fn>") | 189 match[1].replaceAll("<anonymous>", "<fn>") |
| 190 .replaceAll("Anonymous function", "<fn>")); | 190 .replaceAll("Anonymous function", "<fn>")); |
| 191 } else { | 191 } else { |
| 192 // The second form looks like " at LOCATION", and is used for anonymous | 192 // The second form looks like " at LOCATION", and is used for anonymous |
| 193 // functions. | 193 // functions. |
| 194 return parseLocation(match[3], "<fn>"); | 194 return parseLocation(match[3], "<fn>"); |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 /// Parses a string representation of a JavaScriptCore stack trace. |
| 199 factory Frame.parseJSCore(String frame) => new Frame.parseV8(frame); |
| 200 |
| 198 /// Parses a string representation of an IE stack frame. | 201 /// Parses a string representation of an IE stack frame. |
| 199 /// | 202 /// |
| 200 /// IE10+ frames look just like V8 frames. Prior to IE10, stack traces can't | 203 /// IE10+ frames look just like V8 frames. Prior to IE10, stack traces can't |
| 201 /// be retrieved. | 204 /// be retrieved. |
| 202 factory Frame.parseIE(String frame) => new Frame.parseV8(frame); | 205 factory Frame.parseIE(String frame) => new Frame.parseV8(frame); |
| 203 | 206 |
| 204 /// Parses a string representation of a Firefox stack frame. | 207 /// Parses a string representation of a Firefox stack frame. |
| 205 factory Frame.parseFirefox(String frame) { | 208 factory Frame.parseFirefox(String frame) { |
| 206 var match = _firefoxSafariFrame.firstMatch(frame); | 209 var match = _firefoxSafariFrame.firstMatch(frame); |
| 207 if (match == null) { | 210 if (match == null) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // their stack frames. However, if we do get a relative path, we should | 287 // their stack frames. However, if we do get a relative path, we should |
| 285 // handle it gracefully. | 288 // handle it gracefully. |
| 286 if (uriOrPath.contains('\\')) return path.windows.toUri(uriOrPath); | 289 if (uriOrPath.contains('\\')) return path.windows.toUri(uriOrPath); |
| 287 return Uri.parse(uriOrPath); | 290 return Uri.parse(uriOrPath); |
| 288 } | 291 } |
| 289 | 292 |
| 290 Frame(this.uri, this.line, this.column, this.member); | 293 Frame(this.uri, this.line, this.column, this.member); |
| 291 | 294 |
| 292 String toString() => '$location in $member'; | 295 String toString() => '$location in $member'; |
| 293 } | 296 } |
| OLD | NEW |