OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 template<typename T> | 65 template<typename T> |
66 v8::Handle<v8::Object> toObjectWrapper(T* domObject, v8::Isolate* isolate) | 66 v8::Handle<v8::Object> toObjectWrapper(T* domObject, v8::Isolate* isolate) |
67 { | 67 { |
68 if (!domObject) | 68 if (!domObject) |
69 return v8::Object::New(); | 69 return v8::Object::New(); |
70 v8::Handle<v8::Value> value = toV8(domObject, v8::Handle<v8::Object>(), isol
ate); | 70 v8::Handle<v8::Value> value = toV8(domObject, v8::Handle<v8::Object>(), isol
ate); |
71 if (value.IsEmpty()) | 71 if (value.IsEmpty()) |
72 return v8::Object::New(); | 72 return v8::Object::New(); |
73 return value.As<v8::Object>(); | 73 return v8::Local<v8::Object>::New(isolate, value.As<v8::Object>()); |
74 } | 74 } |
75 | 75 |
76 v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(ScriptExecutionCo
ntext* context, v8::Handle<v8::Value> jsEvent, Event* event) | 76 v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(ScriptExecutionCo
ntext* context, v8::Handle<v8::Value> jsEvent, Event* event) |
77 { | 77 { |
78 v8::Local<v8::Object> listenerObject = getListenerObject(context); | 78 v8::Local<v8::Object> listenerObject = getListenerObject(context); |
79 if (listenerObject.IsEmpty()) | 79 if (listenerObject.IsEmpty()) |
80 return v8::Local<v8::Value>(); | 80 return v8::Local<v8::Value>(); |
81 | 81 |
82 v8::Local<v8::Function> handlerFunction = listenerObject.As<v8::Function>(); | 82 v8::Local<v8::Function> handlerFunction = listenerObject.As<v8::Function>(); |
83 v8::Local<v8::Object> receiver = getReceiverObject(context, event); | 83 v8::Local<v8::Object> receiver = getReceiverObject(context, event); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // // Since we only parse once, there's no need to keep data used for parsin
g around anymore. | 238 // // Since we only parse once, there's no need to keep data used for parsin
g around anymore. |
239 // m_functionName = String(); | 239 // m_functionName = String(); |
240 // m_code = String(); | 240 // m_code = String(); |
241 // m_eventParameterName = String(); | 241 // m_eventParameterName = String(); |
242 // m_sourceURL = String(); | 242 // m_sourceURL = String(); |
243 | 243 |
244 setListenerObject(wrappedFunction); | 244 setListenerObject(wrappedFunction); |
245 } | 245 } |
246 | 246 |
247 } // namespace WebCore | 247 } // namespace WebCore |
OLD | NEW |