Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Unified Diff: pkg/stack_trace/lib/src/frame.dart

Issue 16097012: Make the StackTrace library better handle core library frames. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/stack_trace/lib/src/trace.dart » ('j') | pkg/stack_trace/test/frame_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/lib/src/frame.dart
diff --git a/pkg/stack_trace/lib/src/frame.dart b/pkg/stack_trace/lib/src/frame.dart
index 335bfbab32e84552468492786525f3f44723bebc..8f1931bc216403a4a3e57f92bde71e6c20220aef 100644
--- a/pkg/stack_trace/lib/src/frame.dart
+++ b/pkg/stack_trace/lib/src/frame.dart
@@ -21,9 +21,15 @@ class Frame {
final Uri uri;
/// The line number on which the code location is located.
+ ///
+ /// This can be null, indicating that the line number is unknown or
+ /// unimportant.
final int line;
/// The column number of the code location.
+ ///
+ /// This can be null, indicating that the column number is unknown or
+ /// unimportant.
final int column;
/// The name of the member in which the code location occurs.
@@ -53,11 +59,8 @@ class Frame {
}
/// A human-friendly description of the code location.
- ///
- /// For Dart core libraries, this will omit the line and column information,
- /// since those are useless for baked-in libraries.
String get location {
- if (isCore) return library;
+ if (line == null || column == null) return library;
return '$library $line:$column';
}
« no previous file with comments | « no previous file | pkg/stack_trace/lib/src/trace.dart » ('j') | pkg/stack_trace/test/frame_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698