Index: Source/bindings/templates/methods.cpp |
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
index fef73d8f73bad922c0d5f64c9f79ae08713ea9be..8ff7b23615683a5de03f43e33ee78260fc3353aa 100644 |
--- a/Source/bindings/templates/methods.cpp |
+++ b/Source/bindings/templates/methods.cpp |
@@ -92,9 +92,11 @@ if (UNLIKELY(info.Length() <= {{argument.index}})) { |
return; |
} |
{% endif %} |
-{% if argument.has_type_checking_interface %} |
+{% if argument.has_type_checking_interface and argument.index != method.distinguishing_argument_index %} |
{# Type checking for wrapper interface types (if interface not implemented, |
- throw a TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} |
+ throw a TypeError), per http://www.w3.org/TR/WebIDL/#es-interface |
+ If the argument is the distinguishing argument for an overloaded method, |
+ the type is checked as part of overload resolution instead. #} |
if (info.Length() > {{argument.index}} && {% if argument.is_nullable %}!isUndefinedOrNull(info[{{argument.index}}]) && {% endif %}!V8{{argument.idl_type}}::hasInstance(info[{{argument.index}}], info.GetIsolate())) { |
{{throw_type_error(method, '"parameter %s is not of type \'%s\'."' % |
(argument.index + 1, argument.idl_type)) | indent}} |