AaronNGray / jsdoc-toolkit

Automatically exported from code.google.com/p/jsdoc-toolkit
0 stars 0 forks source link

@inherit token #286

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

It would be usefull to support this token in order to manage superclass and
constructor chaining.

Original issue reported on code.google.com by sdol...@gmail.com on 26 Mar 2010 at 8:09

GoogleCodeExporter commented 9 years ago
Can you give an example of how it would be applied?

There is a @borrows tag, which might be similar to what you want...

/**
@constructor
@name Foo
*/

/**
@function
@name Foo#fip
*/

/**
@constructor
@name Bar
@borrows Foo#fip as bip
*/

Likewise there is an @augments tag which would be like borrowing every member 
all at once. Is that what you 
mean?

Original comment by micmath on 26 Mar 2010 at 11:50

GoogleCodeExporter commented 9 years ago
/**
* @class
*/
function person(name)
{
  this.name = name;
}

// Here is an example of subclassing:
/**
* @class
* @inherits person
*/
function Student(name, study)
{
  Person.call(this, name);

  this.study = study;
}
Student.prototype = new Person();
delete Student.prototype.name;
Student.prototype.constructor = Student;

// Here is an example of constructor chaining with superclass:
/**
* @class
* @inherits Person
*
function Girl(name, hairColor){
  this.superclass(name);
  this.hairColor = hairColor
}
Girl.prototype.superclass = Person;

Original comment by sdol...@gmail.com on 26 Mar 2010 at 1:16

GoogleCodeExporter commented 9 years ago
It's seems not to be like @borrows.

Original comment by sdol...@gmail.com on 26 Mar 2010 at 1:21

GoogleCodeExporter commented 9 years ago
"Likewise there is an @augments tag which would be like borrowing every member 
all at once. Is that what you 
mean?"

Original comment by micmath on 26 Mar 2010 at 1:34

GoogleCodeExporter commented 9 years ago
Yes it is. 
Thanks a lot.

ps: sorry for my miss.

Original comment by sdol...@gmail.com on 26 Mar 2010 at 1:39

GoogleCodeExporter commented 9 years ago
micmath,

Should the status on this be changed to invalid? since there is already a way 
to accomplish this.

Original comment by abyss...@gmail.com on 5 Jul 2010 at 12:40

GoogleCodeExporter commented 9 years ago
Hi, 
Yes, I confirm.

Original comment by sdol...@gmail.com on 5 Jul 2010 at 9:21

GoogleCodeExporter commented 9 years ago

Original comment by micmath on 5 Jul 2010 at 9:26