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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(
listener); | 115 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(
listener); |
116 v8::Handle<v8::Context> context = toV8Context(document, v8Listener->world())
; | 116 v8::Handle<v8::Context> context = toV8Context(document, v8Listener->world())
; |
117 v8::Context::Scope contextScope(context); | 117 v8::Context::Scope contextScope(context); |
118 v8::Handle<v8::Object> object = v8Listener->getListenerObject(document); | 118 v8::Handle<v8::Object> object = v8Listener->getListenerObject(document); |
119 if (object.IsEmpty()) | 119 if (object.IsEmpty()) |
120 return ""; | 120 return ""; |
121 v8::Handle<v8::Function> function = eventListenerEffectiveFunction(scope.Get
Isolate(), object); | 121 v8::Handle<v8::Function> function = eventListenerEffectiveFunction(scope.Get
Isolate(), object); |
122 if (function.IsEmpty()) | 122 if (function.IsEmpty()) |
123 return ""; | 123 return ""; |
124 | 124 |
125 TOSTRING_DEFAULT(V8StringResource<WithNullCheck>, functionString, function,
""); | 125 TOSTRING_DEFAULT(V8StringResource<TreatNullAsNullString>, functionString, fu
nction, ""); |
126 return functionString; | 126 return functionString; |
127 } | 127 } |
128 | 128 |
129 ScriptValue eventListenerHandler(Document* document, EventListener* listener) | 129 ScriptValue eventListenerHandler(Document* document, EventListener* listener) |
130 { | 130 { |
131 if (listener->type() != EventListener::JSEventListenerType) | 131 if (listener->type() != EventListener::JSEventListenerType) |
132 return ScriptValue(); | 132 return ScriptValue(); |
133 | 133 |
134 v8::Isolate* isolate = toIsolate(document); | 134 v8::Isolate* isolate = toIsolate(document); |
135 v8::HandleScope scope(isolate); | 135 v8::HandleScope scope(isolate); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); | 173 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); |
174 if (!origin.ResourceName().IsEmpty() && origin.ResourceName()->IsString()) | 174 if (!origin.ResourceName().IsEmpty() && origin.ResourceName()->IsString()) |
175 sourceName = toCoreString(origin.ResourceName().As<v8::String>()); | 175 sourceName = toCoreString(origin.ResourceName().As<v8::String>()); |
176 else | 176 else |
177 sourceName = ""; | 177 sourceName = ""; |
178 lineNumber = originalFunction->GetScriptLineNumber(); | 178 lineNumber = originalFunction->GetScriptLineNumber(); |
179 return true; | 179 return true; |
180 } | 180 } |
181 | 181 |
182 } // namespace WebCore | 182 } // namespace WebCore |
OLD | NEW |