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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/execution.h" | 8 #include "src/execution.h" |
9 #include "src/heap/spaces-inl.h" | 9 #include "src/heap/spaces-inl.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 for (int i = 0; i < global_length; i++) { | 105 for (int i = 0; i < global_length; i++) { |
106 HandleScope scope(isolate); | 106 HandleScope scope(isolate); |
107 if (global_listeners.get(i)->IsUndefined()) continue; | 107 if (global_listeners.get(i)->IsUndefined()) continue; |
108 v8::NeanderObject listener(JSObject::cast(global_listeners.get(i))); | 108 v8::NeanderObject listener(JSObject::cast(global_listeners.get(i))); |
109 Handle<Foreign> callback_obj(Foreign::cast(listener.get(0))); | 109 Handle<Foreign> callback_obj(Foreign::cast(listener.get(0))); |
110 v8::MessageCallback callback = | 110 v8::MessageCallback callback = |
111 FUNCTION_CAST<v8::MessageCallback>(callback_obj->foreign_address()); | 111 FUNCTION_CAST<v8::MessageCallback>(callback_obj->foreign_address()); |
112 Handle<Object> callback_data(listener.get(1), isolate); | 112 Handle<Object> callback_data(listener.get(1), isolate); |
113 { | 113 { |
114 // Do not allow exceptions to propagate. | 114 // Do not allow exceptions to propagate. |
115 v8::TryCatch try_catch; | 115 v8::TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate)); |
116 callback(api_message_obj, callback_data->IsUndefined() | 116 callback(api_message_obj, callback_data->IsUndefined() |
117 ? api_exception_obj | 117 ? api_exception_obj |
118 : v8::Utils::ToLocal(callback_data)); | 118 : v8::Utils::ToLocal(callback_data)); |
119 } | 119 } |
120 if (isolate->has_scheduled_exception()) { | 120 if (isolate->has_scheduled_exception()) { |
121 isolate->clear_scheduled_exception(); | 121 isolate->clear_scheduled_exception(); |
122 } | 122 } |
123 } | 123 } |
124 } | 124 } |
125 } | 125 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 builder.AppendString(args[i++]); | 361 builder.AppendString(args[i++]); |
362 } | 362 } |
363 } else { | 363 } else { |
364 builder.AppendCharacter(*c); | 364 builder.AppendCharacter(*c); |
365 } | 365 } |
366 } | 366 } |
367 | 367 |
368 return builder.Finish(); | 368 return builder.Finish(); |
369 } | 369 } |
370 } } // namespace v8::internal | 370 } } // namespace v8::internal |
OLD | NEW |