Subj : Re: javadoc-like tool for JS? To : netscape.public.mozilla.jseng From : Harald Albrecht Date : Sat Feb 08 2003 03:59 pm Smaug wrote: > Todd Trimmer wrote: >> The funny thing about JavaScript is that the constructor and class are >> the >> same verbal scope. I was thinking of a @constructor tag to differentiate >> comments about to instantiate the class from the workings of the class >> itself. > > Just wondering what you mean about class. Isn't JavaScript a > prototype based language. There is no classes (yet, we have to wait JS > 2.0). As far as I understand, every arbitrary function can act as a "constructor". It is just a function setting up the slots of an object created using new. I think that something like @constructor is required in order to tag the semantics of a function. Or has anyone an idea how to safely deduce this from the code? I think that locking for new operators and then using the given constructors could help only in those cases where we do not only have source code of a library but also of its use. -- Harald .