do you want to be able to annotate functions as "@param {Mixin}"?
Nope, you're missing something :)
Closure Compiler does not use type information to decide how to
rename properties in ADVANCED mode. (There are ways that you can tell
it to use type information, but they are only available from the Java
API).
So in your example, it would rename prepareOptions to something short
(like qD), but it rename every prepareOptions property in your program
to that.
>
>
> The reason I'm trying to achieve #2
> --------------------------------------------------
> Is rather straightforward: I need relevant and complete
> documentation :)
>
>
>
> So, in summary, what I want is, as Nick says: copy [mixins] properties
> to different classes.
> As I said previously, I could do this manually, but I have a pretty
> large codebase, and it would take me a looong time to change my code
> to do direct assignments of the form:
> "Child.prototype.prepareOptions = Mixin.prototype.prepareOptions".
>
> I'm just trying to find a way to avoid having to do that
> manually. ..but there appears to be none, alas.
There's currently no way to do this.
I don't think it would be implement what you want. Someone just has to
sit down and figure out what the syntax and semantics would be. There
are subtle differences in semantics that make this tricky.
multiple @extends doesn't quite fit because of the single-prototype issue
I've talked to people that are really excited about Traits for JS
http://soft.vub.ac.be/~tvcutsem/traitsjs/index.html
but I haven't really been following the discussion, or gotten a chance
to use them.
The compiler currently support @lends
http://code.google.com/p/jsdoc-toolkit/wiki/TagLends
But it only works for object literals mixed-in to one type, and not
for something mixed-in to multiple types.
And then of course you would want something that works with jsdoc-toolkit.
thoughts?
Nick
getClassesDefinedByCall allows you to define your own function that does mixins.
applySubclassRelationship will let you add properties based on the
mixin relationship.