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

Unified Diff: src/top.cc

Issue 6538081: Properly reset external catcher if exception couldn't be externally caught. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | « no previous file | test/mjsunit/regress/regress-1184.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/top.cc
diff --git a/src/top.cc b/src/top.cc
index 83d7de3afee6a43904ed7182cb7d75b8883bdad7..78db26a50973975caeed7d114c5e48d5c5b130a6 100644
--- a/src/top.cc
+++ b/src/top.cc
@@ -735,9 +735,8 @@ Failure* Top::ReThrow(MaybeObject* exception, MessageLocation* location) {
bool can_be_caught_externally = false;
ShouldReportException(&can_be_caught_externally,
is_catchable_by_javascript(exception));
- if (can_be_caught_externally) {
- thread_local_.catcher_ = try_catch_handler();
- }
+ thread_local_.catcher_ = can_be_caught_externally ?
+ try_catch_handler() : NULL;
// Set the exception being re-thrown.
set_pending_exception(exception);
@@ -913,9 +912,10 @@ void Top::DoThrow(MaybeObject* exception,
}
}
- if (can_be_caught_externally) {
- thread_local_.catcher_ = try_catch_handler();
- }
+ // Do not forget to clean catcher_ if currently thrown exception cannot
+ // be caught. If necessary, ReThrow will update the catcher.
+ thread_local_.catcher_ = can_be_caught_externally ?
+ try_catch_handler() : NULL;
// NOTE: Notifying the debugger or generating the message
// may have caused new exceptions. For now, we just ignore
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1184.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698