mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Auto merge of #5902 - nox:length, r=jdm
Blocked by https://github.com/w3c/testharness.js/pull/124. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5902) <!-- Reviewable:end -->
This commit is contained in:
commit
8faa9f877d
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