| Index: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| diff --git a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| index 8b452af03f32c73f39a70ae1619c073f9095e8b6..20a33bf95787600b8dc392d0b053da71d3839990 100644
|
| --- a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| +++ b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| @@ -80,6 +80,23 @@ ScriptValue InjectedScriptHost::nodeAsScriptValue(ScriptState* scriptState, Node
|
| return ScriptValue(scriptState, toV8(node, scriptState->context()->Global(), isolate));
|
| }
|
|
|
| +EventTarget* InjectedScriptHost::scriptValueAsEventTarget(ScriptState* scriptState, ScriptValue value)
|
| +{
|
| + ScriptState::Scope scope(scriptState);
|
| + if (!value.isObject() || value.isNull())
|
| + return nullptr;
|
| + v8::Isolate* isolate = scriptState->isolate();
|
| + EventTarget* target = V8EventTarget::toImplWithTypeCheck(isolate, v8::Local<v8::Object>::Cast(value.v8Value()));
|
| +
|
| + // We need to handle a LocalDOMWindow specially, because a LocalDOMWindow wrapper exists on a prototype chain.
|
| + if (!target)
|
| + target = toDOMWindow(isolate, v8::Local<v8::Object>::Cast(value.v8Value()));
|
| +
|
| + if (!target || !target->executionContext())
|
| + return nullptr;
|
| + return target;
|
| +}
|
| +
|
| void V8InjectedScriptHost::inspectedObjectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| if (info.Length() < 1)
|
|
|