-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Most doclet properties on ES2015 constructors are ignored #1129
Comments
This is the intended behavior. For an ES2015 class, JSDoc creates two doclets: one for the class declaration, and another for the constructor. JSDoc then merges the second doclet into the first, so the second doclet is no longer needed. (We have to merge the doclets to prevent the class from being documented twice.) |
i had a look at the code, it seems only i'm still getting my head round the ES2015 differences.. for example, class instance members.. for global ES2015 classes, the instance members are a
but in a ES2015 class exported from a module, each instance member has a different parent - the constructor..
|
You're right! I wasn't thinking about that when I implemented the feature. I think it's fair to say that this is a bug. I'm reopening this issue to address that bug.
Can you explain why you think this is wrong? To me, it seems like the exact same (correct) behavior you get with this ES5 code: /** @module es5-class */
/**
* Exported class
* @class
*/
exports.ExportedClass = function() {
/** propOne */
this.propOne = '';
}; |
interesting, yes i now see that a directly exported ES5 class behaves the same way.. the direct /**
* @module example
*/
exports.something = something
/**
* @alias module:example
*/
function something () {} |
Fixed on master. The fix will be included in JSDoc 3.6.0. |
hi.. here's some output from a simple ES6 class..notice the second class record (the constructor) shows
undocumented: true
despite being documented..The text was updated successfully, but these errors were encountered: