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

Unified Diff: tool/input_sdk/lib/core/stacktrace.dart

Issue 1720473002: Support StackTrace.current (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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
Index: tool/input_sdk/lib/core/stacktrace.dart
diff --git a/tool/input_sdk/lib/core/stacktrace.dart b/tool/input_sdk/lib/core/stacktrace.dart
index ef8cc4dbb4adfac17f33fef5f28d31fe15d45a2c..a3b7a4f2e9395b9d0ef395296bb9c72bfd67fa28 100644
--- a/tool/input_sdk/lib/core/stacktrace.dart
+++ b/tool/input_sdk/lib/core/stacktrace.dart
@@ -15,6 +15,18 @@ part of dart.core;
*/
abstract class StackTrace {
/**
+ * 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

Powered by Google App Engine
This is Rietveld 408576698