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

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

Issue 1152023004: dart2js: reuse stack trace on rethrow (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | tests/compiler/dart2js_extra/identical_trace_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index 02ef267082e332bf5b6d1e49159a20c8eecb49e0..f1ef96ce3eea6c47b24d678700aef78d3f404d7d 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -2052,7 +2052,11 @@ StackTrace getTraceFromException(exception) {
if (exception is ExceptionAndStackTrace) {
return exception.stackTrace;
}
- return new _StackTrace(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 {
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/identical_trace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698