| 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:pathos/path.dart' as path; | 8 import 'package:pathos/path.dart' as path; |
| 9 | 9 |
| 10 import 'trace.dart'; | 10 import 'trace.dart'; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 /// | 35 /// |
| 36 /// Anonymous closures are represented as `<fn>` in this member string. | 36 /// Anonymous closures are represented as `<fn>` in this member string. |
| 37 final String member; | 37 final String member; |
| 38 | 38 |
| 39 /// Whether this stack frame comes from the Dart core libraries. | 39 /// Whether this stack frame comes from the Dart core libraries. |
| 40 bool get isCore => uri.scheme == 'dart'; | 40 bool get isCore => uri.scheme == 'dart'; |
| 41 | 41 |
| 42 /// Returns a human-friendly description of the library that this stack frame | 42 /// Returns a human-friendly description of the library that this stack frame |
| 43 /// comes from. | 43 /// comes from. |
| 44 /// | 44 /// |
| 45 /// This will usually be the string form of [uri], but a relative path will be | 45 /// This will usually be the string form of [uri], but a relative URI will be |
| 46 /// used if possible. | 46 /// used if possible. |
| 47 String get library { | 47 String get library { |
| 48 if (uri.scheme != 'file') return uri.toString(); | 48 if (uri.scheme != 'file') return uri.toString(); |
| 49 return path.relative(path.fromUri(uri)); | 49 return path.relative(path.fromUri(uri)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 /// Returns the name of the package this stack frame comes from, or `null` if | 52 /// Returns the name of the package this stack frame comes from, or `null` if |
| 53 /// this stack frame doesn't come from a `package:` URL. | 53 /// this stack frame doesn't come from a `package:` URL. |
| 54 String get package { | 54 String get package { |
| 55 if (uri.scheme != 'package') return null; | 55 if (uri.scheme != 'package') return null; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 var uri = Uri.parse(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 |