Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/infer/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ function inferParams(comment: Comment) {

function inferAndCombineParams(params, comment) {
const inferredParams = params.map((param, i) => paramToDoc(param, '', i));
const mergedParamsAndErrors = mergeTrees(inferredParams, comment.params);
const paramsToMerge = comment.params;
if (comment.constructorComment) {
paramsToMerge.push.apply(paramsToMerge, comment.constructorComment.params);
}
const mergedParamsAndErrors = mergeTrees(inferredParams, paramsToMerge);

// Then merge the trees. This is the hard part.
return Object.assign(comment, {
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function _addComment(

if (t.isClassMethod(path) && path.node.kind === 'constructor') {
// #689
if (!comment.hideconstructor) {
if (comment.tags.some(tag => tag.title !== 'param' && tag.title !== 'hideconstructor')) {
debuglog(
'A constructor was documented explicitly: document along with the class instead'
);
Expand Down