Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 171533006: V8 Binding: Introduce toNativeWithTypeCheck (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/custom/V8DocumentCustom.cpp ('k') | Source/bindings/v8/custom/V8NodeCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
diff --git a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index b19d116e1d339bc6d852f875f96bf70fcad00ac3..1fbfd5082e99560cf8a34737e346de98551b6136 100644
--- a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -279,11 +279,9 @@ void V8InjectedScriptHost::getEventListenersMethodCustom(const v8::FunctionCallb
if (info.Length() < 1)
return;
- EventTarget* target = 0;
- v8::Local<v8::Value> value = info[0];
- if (V8EventTarget::hasInstance(value, info.GetIsolate()))
- target = V8EventTarget::toNative(value->ToObject());
+ v8::Local<v8::Value> value = info[0];
+ EventTarget* target = V8EventTarget::toNativeWithTypeCheck(info.GetIsolate(), value);
// We need to handle a DOMWindow specially, because a DOMWindow wrapper exists on a prototype chain.
if (!target)
« no previous file with comments | « Source/bindings/v8/custom/V8DocumentCustom.cpp ('k') | Source/bindings/v8/custom/V8NodeCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698