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..36816ee615b4ff30adc04ce0f03378c1e9c72ae6 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()) |
|
Nils Barth (inactive)
2013/10/22 01:46:38
We should be able to combine these tests, right?
(
haraken
2013/10/22 02:05:14
You're right.
|
| + 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 input should be treated as null |
| + if (!value->IsNull() && !value->IsFunction()) |
| + value = v8::Null(isolate); |
| if (!value->IsObject()) |
| return 0; |