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

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

Issue 18170002: Properly handle empty stack traces in package:stack_trace. (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/test/trace_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/lib/src/trace.dart
diff --git a/pkg/stack_trace/lib/src/trace.dart b/pkg/stack_trace/lib/src/trace.dart
index 4abf55ade2d232d9c4028e6d3be3a288db870dee..db7a40454cf81b66c4af74305c64be2165f56e3f 100644
--- a/pkg/stack_trace/lib/src/trace.dart
+++ b/pkg/stack_trace/lib/src/trace.dart
@@ -143,10 +143,9 @@ class Trace implements StackTrace {
/// Returns a human-readable string representation of [this].
String toString() {
- if (frames.length == '') return '';
-
// Figure out the longest path so we know how much to pad.
- var longest = frames.map((frame) => frame.location.length).reduce(math.max);
+ var longest = frames.map((frame) => frame.location.length)
+ .fold(0, math.max);
// Print out the stack trace nicely formatted.
return frames.map((frame) {
« no previous file with comments | « no previous file | pkg/stack_trace/test/trace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698