| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(
listener); | 121 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(
listener); |
| 122 v8::Handle<v8::Context> context = toV8Context(document, v8Listener->world())
; | 122 v8::Handle<v8::Context> context = toV8Context(document, v8Listener->world())
; |
| 123 v8::Context::Scope contextScope(context); | 123 v8::Context::Scope contextScope(context); |
| 124 v8::Handle<v8::Object> object = v8Listener->getListenerObject(document); | 124 v8::Handle<v8::Object> object = v8Listener->getListenerObject(document); |
| 125 if (object.IsEmpty()) | 125 if (object.IsEmpty()) |
| 126 return ""; | 126 return ""; |
| 127 v8::Handle<v8::Function> function = eventListenerEffectiveFunction(scope.Get
Isolate(), object); | 127 v8::Handle<v8::Function> function = eventListenerEffectiveFunction(scope.Get
Isolate(), object); |
| 128 if (function.IsEmpty()) | 128 if (function.IsEmpty()) |
| 129 return ""; | 129 return ""; |
| 130 | 130 |
| 131 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<WithNullCheck>, func
tionString, function, ""); | 131 TOSTRING_BOOL_BOOL(V8StringResource<WithNullCheck>, functionString, function
, ""); |
| 132 return functionString; | 132 return functionString; |
| 133 } | 133 } |
| 134 | 134 |
| 135 ScriptValue eventListenerHandler(Document* document, EventListener* listener) | 135 ScriptValue eventListenerHandler(Document* document, EventListener* listener) |
| 136 { | 136 { |
| 137 if (listener->type() != EventListener::JSEventListenerType) | 137 if (listener->type() != EventListener::JSEventListenerType) |
| 138 return ScriptValue(); | 138 return ScriptValue(); |
| 139 | 139 |
| 140 v8::Isolate* isolate = toIsolate(document); | 140 v8::Isolate* isolate = toIsolate(document); |
| 141 v8::HandleScope scope(isolate); | 141 v8::HandleScope scope(isolate); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); | 179 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); |
| 180 if (!origin.ResourceName().IsEmpty() && origin.ResourceName()->IsString()) | 180 if (!origin.ResourceName().IsEmpty() && origin.ResourceName()->IsString()) |
| 181 sourceName = toCoreString(origin.ResourceName().As<v8::String>()); | 181 sourceName = toCoreString(origin.ResourceName().As<v8::String>()); |
| 182 else | 182 else |
| 183 sourceName = ""; | 183 sourceName = ""; |
| 184 lineNumber = originalFunction->GetScriptLineNumber(); | 184 lineNumber = originalFunction->GetScriptLineNumber(); |
| 185 return true; | 185 return true; |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace WebCore | 188 } // namespace WebCore |
| OLD | NEW |