Index: third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
index 9d3e726aaf15fdabe48c4568727bec62f5e7bad2..a4fb97619af188d899c3abdbb07e50c4dd40c0f0 100644 |
--- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
+++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
@@ -177,7 +177,7 @@ if (info.Length() <= {{argument.index}} || !{% if argument.is_nullable %}(info[{ |
{% endif %}{# argument.is_optional #} |
{% endif %}{# argument.idl_type == 'EventListener' #} |
{% elif argument.is_callback_function %} |
-if (!info[{{argument.index}}]->IsFunction(){% if argument.is_nullable %} && !info[{{argument.index}}]->IsNull(){% endif %}) { |
+if (!info[{{argument.index}}]->IsObject() || !v8::Local<v8::Object>::Cast(info[{{argument.index}}])->IsCallable()) { |
{{throw_argument_error(method, argument, "The callback provided as parameter %(index)d is not a function.")}} |
return; |
} |