tj/dox

Class properties support

A opened this issue · 1 comments

A commented

My next problem with ES6 syntax is class properties (which is this props ordinary). If I set this props with jsdoc in constructor then I'll reset the parentContext.

Here is my test case:

/**
 * @class Button
 */
class Button extends Backbone.View {

  /**
   * Good. `ctx.string` is `Button.prototype.initialize`
   * @constructor
   */
  initialize() {

    /**
     * that's resetting `parentContext`
     * @type {Boolean}
     * @api public
     */
    this.state = true;

  }

  /**
   * `ctx.string` is `render` instead `Button.prototype.render()`
   * @return {Object} this
   */
  render() {
    return this;
  }

}

Result:

~/Desktop ❯ dox -a < test.js
... 

## new Button()

## Button.prototype.initialize()

  Good. `ctx.string` is `Button.prototype.initialize`

## this.state

  that's resetting `parentContext`

## undefined.render()

A commented

And what I'm expected to see:

~/Desktop ❯ dox -a < test.js
...

## new Button()

## Button.prototype.initialize()

...

## Button.prototype.state

...

## Button.prototype.render()