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

Unified Diff: tool/input_sdk/patch/core_patch.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
« no previous file with comments | « tool/input_sdk/lib/core/stacktrace.dart ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/patch/core_patch.dart
diff --git a/tool/input_sdk/patch/core_patch.dart b/tool/input_sdk/patch/core_patch.dart
index 549c5df7b3ba8589e339bde8e9f448927399ae48..d557375c54b5bf3662b5ce40c99891fcc627bc14 100644
--- a/tool/input_sdk/patch/core_patch.dart
+++ b/tool/input_sdk/patch/core_patch.dart
@@ -452,3 +452,24 @@ class Uri {
throw new UnsupportedError("'Uri.base' is not supported");
}
}
+
+@patch
+class StackTrace {
+ @patch
+ @NoInline()
Jennifer Messerly 2016/02/19 22:23:56 I think I've been removing these, they're meaningl
+ static StackTrace get current {
+ var error = JS('', 'new Error()');
+ var stack = JS('String|Null', '#.stack', error);
+ if (stack is String) return new StackTrace.fromString(stack);
+ if (JS('', 'Error.captureStackTrace') != null) {
+ JS('void', 'Error.captureStackTrace(#)', error);
+ var stack = JS('String|Null', '#.stack', error);
+ if (stack is String) return new StackTrace.fromString(stack);
+ }
+ try {
+ throw 0;
+ } catch (_, stackTrace) {
+ return stackTrace;
+ }
+ }
+}
« no previous file with comments | « tool/input_sdk/lib/core/stacktrace.dart ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698