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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (thisObject.IsEmpty()) | 181 if (thisObject.IsEmpty()) |
182 return; | 182 return; |
183 if (!v8CallBoolean(thisObject->ForceSet(scriptState->context(), v8::Integer:
:New(isolate(), 0), nodeWrapper))) | 183 if (!v8CallBoolean(thisObject->ForceSet(scriptState->context(), v8::Integer:
:New(isolate(), 0), nodeWrapper))) |
184 return; | 184 return; |
185 if (!v8CallBoolean(thisObject->ForceSet(scriptState->context(), v8::Integer:
:New(isolate(), 1), formWrapper))) | 185 if (!v8CallBoolean(thisObject->ForceSet(scriptState->context(), v8::Integer:
:New(isolate(), 1), formWrapper))) |
186 return; | 186 return; |
187 if (!v8CallBoolean(thisObject->ForceSet(scriptState->context(), v8::Integer:
:New(isolate(), 2), documentWrapper))) | 187 if (!v8CallBoolean(thisObject->ForceSet(scriptState->context(), v8::Integer:
:New(isolate(), 2), documentWrapper))) |
188 return; | 188 return; |
189 | 189 |
190 // FIXME: Remove this code when we stop doing the 'with' hack above. | 190 // FIXME: Remove this code when we stop doing the 'with' hack above. |
191 v8::Local<v8::Value> innerValue = V8ScriptRunner::callInternalFunction(inter
mediateFunction, thisObject, 0, 0, isolate()); | 191 v8::Local<v8::Value> innerValue; |
192 if (innerValue.IsEmpty() || !innerValue->IsFunction()) | 192 if (!V8ScriptRunner::callInternalFunction(intermediateFunction, thisObject,
0, 0, isolate()).ToLocal(&innerValue) || !innerValue->IsFunction()) |
193 return; | 193 return; |
194 | 194 |
195 v8::Local<v8::Function> wrappedFunction = innerValue.As<v8::Function>(); | 195 v8::Local<v8::Function> wrappedFunction = innerValue.As<v8::Function>(); |
196 | 196 |
197 // Change the toString function on the wrapper function to avoid it | 197 // Change the toString function on the wrapper function to avoid it |
198 // returning the source for the actual wrapper function. Instead it | 198 // returning the source for the actual wrapper function. Instead it |
199 // returns source for a clean wrapper function with the event | 199 // returns source for a clean wrapper function with the event |
200 // argument wrapping the event source code. The reason for this is | 200 // argument wrapping the event source code. The reason for this is |
201 // that some web sites use toString on event functions and eval the | 201 // that some web sites use toString on event functions and eval the |
202 // source returned (sometimes a RegExp is applied as well) for some | 202 // source returned (sometimes a RegExp is applied as well) for some |
(...skipping 15 matching lines...) Expand all Loading... |
218 // // Since we only parse once, there's no need to keep data used for parsin
g around anymore. | 218 // // Since we only parse once, there's no need to keep data used for parsin
g around anymore. |
219 // m_functionName = String(); | 219 // m_functionName = String(); |
220 // m_code = String(); | 220 // m_code = String(); |
221 // m_eventParameterName = String(); | 221 // m_eventParameterName = String(); |
222 // m_sourceURL = String(); | 222 // m_sourceURL = String(); |
223 | 223 |
224 setListenerObject(wrappedFunction); | 224 setListenerObject(wrappedFunction); |
225 } | 225 } |
226 | 226 |
227 } // namespace blink | 227 } // namespace blink |
OLD | NEW |