diff --git a/src/infer/params.js b/src/infer/params.js index 117222fa4..c586630b7 100644 --- a/src/infer/params.js +++ b/src/infer/params.js @@ -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, { diff --git a/src/parsers/javascript.js b/src/parsers/javascript.js index 1df33fbab..d6a21f74c 100644 --- a/src/parsers/javascript.js +++ b/src/parsers/javascript.js @@ -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' );