Re: [gabriel.reid@gmail.com: Re: [Jsdoc-user] fix for objects that are extended with this.base membe
Status: Inactive
Brought to you by:
mmathews
|
From: Gabriel R. <gab...@gm...> - 2005-09-02 05:30:05
|
On Thu, Sep 01, 2005 at 05:54:30PM -0700, Justin Early wrote:
> Hi Gabriel,
> Here is the example of a where you can use this:
> function MyBaseClass(pName)
> {
> this.name <http://this.name> = pName;
> this.prop1 = "test";
> }
> function MyExtendedBaseClass(pName)
> {
> //set Base class
> this.base = MyBaseClass;
> this.base(pName);
> }
> Examples are here:
> http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:The_Employee_Example:More_Flexible_Constructors
I'm not really in favour of adding this to the code of JSDoc, as the
'base' object isn't actually part of JavaScript or ECMAScript. Although
it's certainly a useful idiom, the 'base' object could just as easily be
called any other name and have the same effect.
Additionally, in the example in the link that you provided, a
constructor is assigned to the prototype of a subclass, which JSDoc will
pick up and represent as subclassing.
Regards,
Gabriel
|