mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Fix length value of interface methods
This commit is contained in:
parent
8979d77e77
commit
d9619853e2
8 changed files with 6 additions and 195 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue