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

Unified Diff: src/messages.cc

Issue 6820003: Allow recursive messages reporting as it is already used. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Yuri's concerns Created 9 years, 8 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 | « src/isolate.h ('k') | src/top.cc » ('j') | test/cctest/test-api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 0cc82512c42842166fc24c92c8c1faf9e50b6d9c..abc25377851b5c4a76a404b5519edf75adc70226 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -104,15 +104,6 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject(
void MessageHandler::ReportMessage(Isolate* isolate,
MessageLocation* loc,
Handle<Object> message) {
- // If we are in process of message reporting, just ignore all other requests
- // to report a message as they are due to unhandled exceptions thrown in
- // message callbacks.
- if (isolate->in_exception_reporting()) {
- PrintF("uncaught exception thrown while reporting\n");
- return;
- }
- isolate->set_in_exception_reporting(true);
-
// We are calling into embedder's code which can throw exceptions.
// Thus we need to save current exception state, reset it to the clean one
// and ignore scheduled exceptions callbacks can throw.
@@ -138,14 +129,16 @@ void MessageHandler::ReportMessage(Isolate* isolate,
v8::MessageCallback callback =
FUNCTION_CAST<v8::MessageCallback>(callback_obj->proxy());
Handle<Object> callback_data(listener.get(1));
- callback(api_message_obj, v8::Utils::ToLocal(callback_data));
+ {
+ // Do not allow exceptions to propagate.
+ v8::TryCatch tryCatch;
Vitaly Repeshko 2011/04/11 19:37:39 nit: noCamelCase
antonm 2011/04/15 12:15:34 Done.
+ callback(api_message_obj, v8::Utils::ToLocal(callback_data));
+ }
if (isolate->has_scheduled_exception()) {
isolate->clear_scheduled_exception();
}
}
}
-
- isolate->set_in_exception_reporting(false);
}
« no previous file with comments | « src/isolate.h ('k') | src/top.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698