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

Unified Diff: sdk/lib/core/stacktrace.dart

Issue 1448003002: Add StackTrace.current getter. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address VM comments. Created 5 years, 1 month 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 | « sdk/lib/_internal/js_runtime/lib/core_patch.dart ('k') | tests/corelib/stacktrace_current_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/stacktrace.dart
diff --git a/sdk/lib/core/stacktrace.dart b/sdk/lib/core/stacktrace.dart
index c8540dc47bb840aa73fd256b5afd939426a2c440..17abd3831ed957102d61eaa16093b9e31e33a8a4 100644
--- a/sdk/lib/core/stacktrace.dart
+++ b/sdk/lib/core/stacktrace.dart
@@ -31,6 +31,18 @@ abstract class StackTrace {
factory StackTrace.fromString(String stackTraceString) = _StringStackTrace;
/**
+ * Returns a representation of the current stack trace.
+ *
+ * This is similar to what can be achieved by doing:
+ *
+ * try { throw 0; } catch (_, stack) { return stack; }
+ *
+ * The getter achieves this without throwing, except on platforms that
+ * have no other way to get a stack trace.
+ */
+ external static StackTrace get current;
+
+ /**
* Returns a [String] representation of the stack trace.
*
* The string represents the full stack trace starting from
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/core_patch.dart ('k') | tests/corelib/stacktrace_current_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698