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); |
} |