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

Unified Diff: lib/src/trace.dart

Issue 1653603002: pkg/stack_trace: Use StackTrace.current (Closed) Base URL: https://github.com/dart-lang/stack_trace.git@master
Patch Set: nits Created 4 years, 11 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/trace.dart
diff --git a/lib/src/trace.dart b/lib/src/trace.dart
index 6d9823b085f9b11ffbe58f78f75fee56bb48a8d4..927a167843efb65e77ff42421a7cdbe144e55a2a 100644
--- a/lib/src/trace.dart
+++ b/lib/src/trace.dart
@@ -81,12 +81,8 @@ class Trace implements StackTrace {
"to 0.");
}
- try {
- throw '';
- } catch (_, nativeTrace) {
- var trace = new Trace.from(nativeTrace);
- return new LazyTrace(() => new Trace(trace.frames.skip(level + 1)));
- }
+ var trace = new Trace.from(StackTrace.current);
+ return new LazyTrace(() => new Trace(trace.frames.skip(level + 1)));
}
/// Returns a new stack trace containing the same data as [trace].
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698