OLD | NEW |
1 | 1 |
2 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 2 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
5 // met: | 5 // met: |
6 // | 6 // |
7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 for (int i = 0; i < global_length; i++) { | 124 for (int i = 0; i < global_length; i++) { |
125 HandleScope scope; | 125 HandleScope scope; |
126 if (global_listeners.get(i)->IsUndefined()) continue; | 126 if (global_listeners.get(i)->IsUndefined()) continue; |
127 v8::NeanderObject listener(JSObject::cast(global_listeners.get(i))); | 127 v8::NeanderObject listener(JSObject::cast(global_listeners.get(i))); |
128 Handle<Proxy> callback_obj(Proxy::cast(listener.get(0))); | 128 Handle<Proxy> callback_obj(Proxy::cast(listener.get(0))); |
129 v8::MessageCallback callback = | 129 v8::MessageCallback callback = |
130 FUNCTION_CAST<v8::MessageCallback>(callback_obj->proxy()); | 130 FUNCTION_CAST<v8::MessageCallback>(callback_obj->proxy()); |
131 Handle<Object> callback_data(listener.get(1)); | 131 Handle<Object> callback_data(listener.get(1)); |
132 { | 132 { |
133 // Do not allow exceptions to propagate. | 133 // Do not allow exceptions to propagate. |
134 v8::TryCatch tryCatch; | 134 v8::TryCatch try_catch; |
135 callback(api_message_obj, v8::Utils::ToLocal(callback_data)); | 135 callback(api_message_obj, v8::Utils::ToLocal(callback_data)); |
136 } | 136 } |
137 if (isolate->has_scheduled_exception()) { | 137 if (isolate->has_scheduled_exception()) { |
138 isolate->clear_scheduled_exception(); | 138 isolate->clear_scheduled_exception(); |
139 } | 139 } |
140 } | 140 } |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 | 144 |
(...skipping 25 matching lines...) Expand all Loading... |
170 } | 170 } |
171 | 171 |
172 | 172 |
173 SmartPointer<char> MessageHandler::GetLocalizedMessage(Handle<Object> data) { | 173 SmartPointer<char> MessageHandler::GetLocalizedMessage(Handle<Object> data) { |
174 HandleScope scope; | 174 HandleScope scope; |
175 return GetMessage(data)->ToCString(DISALLOW_NULLS); | 175 return GetMessage(data)->ToCString(DISALLOW_NULLS); |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 } } // namespace v8::internal | 179 } } // namespace v8::internal |
OLD | NEW |