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

Unified Diff: src/messages.cc

Issue 12378069: Merged r13762 into 3.16 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.16
Patch Set: Created 7 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 | « src/api.cc ('k') | src/version.cc » ('j') | no next file with comments »
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 801930d2b3f4b86b2dacb9b5ffe2ef3b5b6c6560..a3461e6a558daf5dbd60d0cea0e79eb8d5129838 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -130,15 +130,19 @@ void MessageHandler::ReportMessage(Isolate* isolate,
}
} else {
for (int i = 0; i < global_length; i++) {
- HandleScope scope;
+ HandleScope scope(isolate);
if (global_listeners.get(i)->IsUndefined()) continue;
- Handle<Foreign> callback_obj(Foreign::cast(global_listeners.get(i)));
+ v8::NeanderObject listener(JSObject::cast(global_listeners.get(i)));
+ Handle<Foreign> callback_obj(Foreign::cast(listener.get(0)));
v8::MessageCallback callback =
FUNCTION_CAST<v8::MessageCallback>(callback_obj->foreign_address());
+ Handle<Object> callback_data(listener.get(1), isolate);
{
// Do not allow exceptions to propagate.
v8::TryCatch try_catch;
- callback(api_message_obj, api_exception_obj);
+ callback(api_message_obj, callback_data->IsUndefined()
+ ? api_exception_obj
+ : v8::Utils::ToLocal(callback_data));
}
if (isolate->has_scheduled_exception()) {
isolate->clear_scheduled_exception();
« no previous file with comments | « src/api.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698