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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 11858017: Nice messages on uncaught exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments and fix a type error Created 7 years, 11 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: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index d94adf17cf8403973a7dda970ff3e20fb0e385a2..5dfacf3744ee2014f2e13a5280af820659396cf2 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -390,11 +390,14 @@ $lazyInitializerLogic
$isolate[fieldName] = sentinelInProgress;
try {
result = $isolate[fieldName] = lazyValue();
- } catch (e) {
- if ($isolate[fieldName] === sentinelInProgress) {
- $isolate[fieldName] = null;
+ } finally {
+""" // Use try-finally, not try-catch/throw as it destroys the stack trace.
+"""
+ if (result === sentinelUndefined) {
+ if ($isolate[fieldName] === sentinelInProgress) {
+ $isolate[fieldName] = null;
+ }
}
- throw e;
}
} else if (result === sentinelInProgress) {
$cyclicThrow(staticName);

Powered by Google App Engine
This is Rietveld 408576698