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

Unified Diff: sdk/lib/_internal/js_runtime/lib/async_patch.dart

Issue 1383213002: Make dart2js code retain the original stack trace for uncaught async errors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/async_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/async_patch.dart b/sdk/lib/_internal/js_runtime/lib/async_patch.dart
index 1155e79f76964886ed61ab0c2006b9ed1c5e292f..450e30b434f693ac6a32b88f95bfb8c45ada91aa 100644
--- a/sdk/lib/_internal/js_runtime/lib/async_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/async_patch.dart
@@ -11,6 +11,7 @@ import 'dart:_js_helper' show
convertDartClosureToJS,
getTraceFromException,
requiresPreamble,
+ wrapException,
unwrapException;
import 'dart:_isolate_helper' show
IsolateNatives,
@@ -509,5 +510,7 @@ class _SyncStarIterable extends IterableBase {
@patch
void _rethrow(Object error, StackTrace stackTrace) {
- throw new AsyncError(error, stackTrace);
+ error = wrapException(error);
+ JS("void", "#.stack = #", error, stackTrace.toString());
Siggi Cherem (dart-lang) 2015/10/05 17:09:33 I'm not super familiar with this logic yet, but I
Lasse Reichstein Nielsen 2015/10/06 07:57:26 As I understand it, the "generally accepted" behav
+ JS("void", "throw #", error);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698