Chromium Code Reviews| Index: Source/bindings/v8/V8EventListenerList.h |
| diff --git a/Source/bindings/v8/V8EventListenerList.h b/Source/bindings/v8/V8EventListenerList.h |
| index 1074983653612b23e81bb4534261ead90aa21e3e..9adddbbb7adbbb8df6d8fc0b2fb9e8043ce49e6f 100644 |
| --- a/Source/bindings/v8/V8EventListenerList.h |
| +++ b/Source/bindings/v8/V8EventListenerList.h |
| @@ -52,10 +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()) |
| + if (!value->IsObject() |
| + // Non-callable attribute setter input is treated as null (no wrapper) |
| + || (isAttribute && !value->IsFunction())) |
|
haraken
2013/10/22 12:05:30
Looks like you newly added the isAttribute check.
Nils Barth (inactive)
2013/10/22 12:16:51
We only want to check if it's a function on attrib
haraken
2013/10/22 12:24:23
Makes sense. However, this changes web-exposed beh
Nils Barth (inactive)
2013/10/23 01:43:51
I looked into this, and found out this is always c
|
| return 0; |
| v8::Handle<v8::String> wrapperProperty = getHiddenProperty(isAttribute, isolate); |
| @@ -94,10 +93,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()) |
| - value = v8::Null(isolate); |
| - if (!value->IsObject()) |
| + if (!value->IsObject() |
| + // Non-callable attribute setter input is treated as null (no wrapper) |
| + || (isAttribute && !value->IsFunction())) |
| return 0; |
| v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); |