Chromium Code Reviews| 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 a4fb97619af188d899c3abdbb07e50c4dd40c0f0..d7009da8926ef9d291c860745512eed8fa1bc1c6 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}}]->IsObject() || !v8::Local<v8::Object>::Cast(info[{{argument.index}}])->IsCallable()) { |
| +if ({% if argument.is_nullable %}!isUndefinedOrNull(info[{{argument.index}}]) && {% endif %}!(info[{{argument.index}}]->IsObject() && v8::Local<v8::Object>::Cast(info[{{argument.index}}])->IsCallable())) { |
|
peria
2017/01/05 04:39:18
who tests this new {% if %} branch in run-binding-
bashi
2017/01/05 04:41:31
TestCallbackFunctions.voidMethodNullableCallbackFu
|
| {{throw_argument_error(method, argument, "The callback provided as parameter %(index)d is not a function.")}} |
| return; |
| } |