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

Unified Diff: src/api.cc

Issue 291393002: Make v8::TryCatch able to consume natively thrown exceptions (again). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 304d84ffcf872d6163a19f8a38ce9e7f8df8eaf3..7a72bc2fb2c1e3413d9e9517af554ee0b64aab9e 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1832,6 +1832,12 @@ v8::TryCatch::~TryCatch() {
reinterpret_cast<Isolate*>(isolate_)->ThrowException(exc);
ASSERT(!isolate_->thread_local_top()->rethrowing_message_);
} else {
+ if (HasCaught() && isolate_->has_scheduled_exception()) {
+ // If an exception was caught but is still scheduled because no API call
+ // promoted it, then it is canceled to prevent it from being propagated.
+ // Note that this will not cancel termination exceptions.
+ isolate_->CancelScheduledExceptionFromTryCatch(this);
+ }
isolate_->UnregisterTryCatchHandler(this);
v8::internal::SimulatorStack::UnregisterCTryCatch();
}
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698