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

Unified Diff: dart/sdk/lib/_internal/lib/js_helper.dart

Issue 78343002: Ensure stack trace are identical. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « no previous file | dart/tests/language/identical_trace_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/lib/js_helper.dart
diff --git a/dart/sdk/lib/_internal/lib/js_helper.dart b/dart/sdk/lib/_internal/lib/js_helper.dart
index 507e89b59ca1481ef67033c3cb4221bc38bcd52a..b92e62f02f8dbb7db7ef82a9bfb406b0aefa5561 100644
--- a/dart/sdk/lib/_internal/lib/js_helper.dart
+++ b/dart/sdk/lib/_internal/lib/js_helper.dart
@@ -1420,7 +1420,13 @@ unwrapException(ex) {
* Called by generated code to fetch the stack trace from an
* exception. Should never return null.
*/
-StackTrace getTraceFromException(exception) => new _StackTrace(exception);
+StackTrace getTraceFromException(exception) {
+ if (exception == null) return new _StackTrace(exception);
+ _StackTrace trace = JS('_StackTrace|Null', r'#.$cachedTrace', exception);
+ if (trace != null) return trace;
+ trace = new _StackTrace(exception);
+ return JS('_StackTrace', r'#.$cachedTrace = #', exception, trace);
+}
class _StackTrace implements StackTrace {
var _exception;
« no previous file with comments | « no previous file | dart/tests/language/identical_trace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698