[ 3 posts ]

akishore

  • Joined: Thu Sep 17, 2009 1:15 pm
  • Posts: 9
  • Offline
  • Profile

@type tag necessary?

Post Posted: Fri Sep 18, 2009 12:01 pm
+0-
After writing a bunch of YUI Doc documentation, I'm finding myself routinely wanting to just be able to do this:

@property {Foo} foo

Instead of:

@property foo
@type Foo

Since in the most common cases -- methods that take parameters -- I can put the type inline via brackets:

@method example
@param {Bar} bar The bar value.
@param {Baz} baz The baz value.
@return {Foo} foo The foo of the two.

So for properties, configs and attributes, do you guys think it might be possible to accept @property {type} name in addition to an explicit @type tag (needed for backwards compat)?

Aseem

Alexandre Morgaut

  • Username: Alexandre.Morgaut
  • Joined: Tue Sep 15, 2009 7:02 am
  • Posts: 8
  • Location: Paris, France
  • Twitter: amorgaut
  • GitHub: AMorgaut
  • Gists: AMorgaut
  • Offline
  • Profile

Re: @type tag necessary?

Post Posted: Wed Mar 10, 2010 9:58 pm
+0-
I think your idea is very logical and sounds fair

The only thing is that @type should still be supported as it is used by other doc generators and quite well know

By the way, an other notation might be accepted,

as we have

@method foo
@return {Number}

you might want to write

@property bar
@return {Number}

Technically, when we get the value of a property, it is returned by is internal getter function (which can be specified via the new ECMAScript 5 Object methods)

Alexandre Morgaut

  • Username: Alexandre.Morgaut
  • Joined: Tue Sep 15, 2009 7:02 am
  • Posts: 8
  • Location: Paris, France
  • Twitter: amorgaut
  • GitHub: AMorgaut
  • Gists: AMorgaut
  • Offline
  • Profile

Re: @type tag necessary?

Post Posted: Wed Mar 10, 2010 10:50 pm
+0-
Sorry, thinking back to it I didn't found Object.create and defineProperty doesn't allow to set getters and setters... here where I found an example of working code which make it possible for some specific engines:

http://ejohn.org/blog/javascript-getters-and-setters/

But well there still is an internal [[Get]] method to access property values
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum