| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/messages.h" | 5 #include "src/messages.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/execution.h" | 10 #include "src/execution.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 int global_length = global_listeners->length(); | 127 int global_length = global_listeners->length(); |
| 128 if (global_length == 0) { | 128 if (global_length == 0) { |
| 129 DefaultMessageReport(isolate, loc, message); | 129 DefaultMessageReport(isolate, loc, message); |
| 130 if (isolate->has_scheduled_exception()) { | 130 if (isolate->has_scheduled_exception()) { |
| 131 isolate->clear_scheduled_exception(); | 131 isolate->clear_scheduled_exception(); |
| 132 } | 132 } |
| 133 } else { | 133 } else { |
| 134 for (int i = 0; i < global_length; i++) { | 134 for (int i = 0; i < global_length; i++) { |
| 135 HandleScope scope(isolate); | 135 HandleScope scope(isolate); |
| 136 if (global_listeners->get(i)->IsUndefined(isolate)) continue; | 136 if (global_listeners->get(i)->IsUndefined(isolate)) continue; |
| 137 v8::NeanderObject listener(JSObject::cast(global_listeners->get(i))); | 137 FixedArray* listener = FixedArray::cast(global_listeners->get(i)); |
| 138 Handle<Foreign> callback_obj(Foreign::cast(listener.get(0))); | 138 Foreign* callback_obj = Foreign::cast(listener->get(0)); |
| 139 v8::MessageCallback callback = | 139 v8::MessageCallback callback = |
| 140 FUNCTION_CAST<v8::MessageCallback>(callback_obj->foreign_address()); | 140 FUNCTION_CAST<v8::MessageCallback>(callback_obj->foreign_address()); |
| 141 Handle<Object> callback_data(listener.get(1), isolate); | 141 Handle<Object> callback_data(listener->get(1), isolate); |
| 142 { | 142 { |
| 143 // Do not allow exceptions to propagate. | 143 // Do not allow exceptions to propagate. |
| 144 v8::TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate)); | 144 v8::TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate)); |
| 145 callback(api_message_obj, callback_data->IsUndefined(isolate) | 145 callback(api_message_obj, callback_data->IsUndefined(isolate) |
| 146 ? api_exception_obj | 146 ? api_exception_obj |
| 147 : v8::Utils::ToLocal(callback_data)); | 147 : v8::Utils::ToLocal(callback_data)); |
| 148 } | 148 } |
| 149 if (isolate->has_scheduled_exception()) { | 149 if (isolate->has_scheduled_exception()) { |
| 150 isolate->clear_scheduled_exception(); | 150 isolate->clear_scheduled_exception(); |
| 151 } | 151 } |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 builder.AppendCString(" ("); | 1158 builder.AppendCString(" ("); |
| 1159 RETURN_ON_EXCEPTION( | 1159 RETURN_ON_EXCEPTION( |
| 1160 isolate, AppendFileLocation(isolate, recv, &call_site, &builder), String); | 1160 isolate, AppendFileLocation(isolate, recv, &call_site, &builder), String); |
| 1161 builder.AppendCString(")"); | 1161 builder.AppendCString(")"); |
| 1162 | 1162 |
| 1163 RETURN_RESULT(isolate, builder.Finish(), String); | 1163 RETURN_RESULT(isolate, builder.Finish(), String); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 } // namespace internal | 1166 } // namespace internal |
| 1167 } // namespace v8 | 1167 } // namespace v8 |
| OLD | NEW |