netzpirat/codo — pull request #41 by grahamlyus (2012-04-21 01:03:37+00:00)
Title: Fix to allow virtual methods without parameters

Was getting ```Get method signature error: undefined [TypeError: Cannot read property 'length' of undefined]``` when using ```@method``` to declare a method without parameters. This fixes it by making ```getParameters``` return an empty array in that case.

I came across this when trying to figure out a way to document my own type of 'mixin' that is returned by an instance method, e.g.

```coffee
class Com.Example.Aspect
mixins: =>
# Does something interesting.
aMixedInMethod: =>
@somePrivateMethod()

# @private
somePrivateMethod: () =>
# do something.
```

The documentation for the methods in ```mixins``` is ignored. I'd tried using a ```@mixin``` tag, but that didn't help, so I ended up going with:

```coffee
# @method #aMixedInMethod
# Does something interesting.
class Com.Example.Aspect
mixins: =>
aMixedInMethod: =>
@somePrivateMethod()

# @private
somePrivateMethod: () =>
# do something.
```

I'd rather find some way of having the doc tags alongside the method if at all possible, if you have any ideas?