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

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

Issue 14647003: Be lazier when capturing stack traces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « pkg/stack_trace/lib/src/lazy_trace.dart ('k') | no next file » | 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 54f99db57bb39082cde1943fd65653d5fe74e954..81651a9e08944634bcbca9765501c57bb7280243 100644
--- a/pkg/stack_trace/lib/src/trace.dart
+++ b/pkg/stack_trace/lib/src/trace.dart
@@ -9,6 +9,7 @@ import 'dart:uri';
import 'dart:math' as math;
import 'frame.dart';
+import 'lazy_trace.dart';
final _patchRegExp = new RegExp(r"-patch$");
@@ -42,7 +43,7 @@ class Trace implements StackTrace {
throw '';
} catch (_, nativeTrace) {
var trace = new Trace.from(nativeTrace);
- return new Trace(trace.frames.skip(level + 1));
+ return new LazyTrace(() => trace.frames.skip(level + 1));
}
}
@@ -52,7 +53,7 @@ class Trace implements StackTrace {
/// a [Trace], it will be returned as-is.
factory Trace.from(StackTrace trace) {
if (trace is Trace) return trace;
- return new Trace.parse(trace.toString());
+ return new LazyTrace(() => Trace.parse(trace.toString()));
}
/// Parses a string representation of a stack trace.
« no previous file with comments | « pkg/stack_trace/lib/src/lazy_trace.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698