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

Unified Diff: Source/bindings/v8/V8EventListenerList.h

Issue 32323012: IDL compiler: move EventHandler null check out of generated bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 2 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
Index: Source/bindings/v8/V8EventListenerList.h
diff --git a/Source/bindings/v8/V8EventListenerList.h b/Source/bindings/v8/V8EventListenerList.h
index def9801a7444810ed1ddab821a107137fad767a1..1074983653612b23e81bb4534261ead90aa21e3e 100644
--- a/Source/bindings/v8/V8EventListenerList.h
+++ b/Source/bindings/v8/V8EventListenerList.h
@@ -52,6 +52,9 @@ public:
static PassRefPtr<V8EventListener> findWrapper(v8::Local<v8::Value> value, bool isAttribute, v8::Isolate* isolate)
{
ASSERT(v8::Context::InContext());
+ // Non-callable input should be treated as null
+ if (!value->IsNull() && !value->IsFunction())
+ value = v8::Null(isolate);
if (!value->IsObject())
return 0;
@@ -91,6 +94,9 @@ template<typename WrapperType>
PassRefPtr<V8EventListener> V8EventListenerList::findOrCreateWrapper(v8::Local<v8::Value> value, bool isAttribute, v8::Isolate* isolate)
{
ASSERT(v8::Context::InContext());
+ // Non-callable attribute setter input should be treated as null
+ if (isAttribute && !value->IsNull() && !value->IsFunction())
Nils Barth (inactive) 2013/10/22 07:29:29 Note the isAttribute check. isAttribute is true fo
+ value = v8::Null(isolate);
if (!value->IsObject())
return 0;

Powered by Google App Engine
This is Rietveld 408576698