From d9619853e210ad70932b7b3b2ab2633a907e1676 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 30 Apr 2015 00:02:36 +0200 Subject: Fix length value of interface methods --- components/script/dom/bindings/codegen/CodegenRust.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/script/dom/bindings/codegen/CodegenRust.py') diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index a005956e02e..689587c377b 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1224,11 +1224,11 @@ class PropertyDefiner: ",\n".join(specs) + "\n" + "];\n") % (name, specType)) -# The length of a method is the maximum of the lengths of the +# The length of a method is the minimum of the lengths of the # argument lists of all its overloads. def methodLength(method): signatures = method.signatures() - return max([len(arguments) for (retType, arguments) in signatures]) + return min(len([arg for arg in arguments if not arg.optional and not arg.variadic]) for (_, arguments) in signatures) class MethodDefiner(PropertyDefiner): """ -- cgit v1.2.3