Chromium Code Reviews| 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; |