Chromium Code Reviews| Index: src/messages.cc |
| diff --git a/src/messages.cc b/src/messages.cc |
| index 42fc3c9bd66fdd2742983340db3b41b0ad158114..91467ab5b9542655304e12442cdb73be31d6aba0 100644 |
| --- a/src/messages.cc |
| +++ b/src/messages.cc |
| @@ -135,6 +135,9 @@ void MessageHandler::ReportMessage(MessageLocation* loc, |
| if (global_length == 0) { |
| DefaultMessageReport(loc, message); |
| } else { |
| + // We are calling into embedder's code. Clean pending exception |
| + // and ignore scheduled exceptions the callback can throw. |
| + Top::clear_pending_exception(); |
|
Mads Ager (chromium)
2011/01/28 11:39:18
Should this be moved to the caller? I think we onl
antonm
2011/01/28 13:37:25
Let me try modified second approach: I'll move all
|
| for (int i = 0; i < global_length; i++) { |
| HandleScope scope; |
| if (global_listeners.get(i)->IsUndefined()) continue; |
| @@ -144,6 +147,10 @@ void MessageHandler::ReportMessage(MessageLocation* loc, |
| FUNCTION_CAST<v8::MessageCallback>(callback_obj->proxy()); |
| Handle<Object> callback_data(listener.get(1)); |
| callback(api_message_obj, v8::Utils::ToLocal(callback_data)); |
| + if (Top::has_scheduled_exception()) { |
| + // Consider logging it somehow. |
|
Vitaly Repeshko
2011/01/28 14:03:33
What if we get an OOM or termination exception her
antonm
2011/01/28 14:43:18
That sounds like a very good point. I think we sh
|
| + Top::clear_scheduled_exception(); |
| + } |
| } |
| } |
| } |