@@ -1463,7 +1463,7 @@ namespace ts {
1463
1463
1464
1464
/// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property
1465
1465
/// assignments we treat as special in the binder
1466
- export function getSpecialPropertyAssignmentKind ( expr : ts . BinaryExpression ) : SpecialPropertyAssignmentKind {
1466
+ export function getSpecialPropertyAssignmentKind ( expr : BinaryExpression ) : SpecialPropertyAssignmentKind {
1467
1467
if ( ! isInJavaScriptFile ( expr ) ) {
1468
1468
return SpecialPropertyAssignmentKind . None ;
1469
1469
}
@@ -1609,22 +1609,25 @@ namespace ts {
1609
1609
1610
1610
function getJSDocCommentsAndTagsWorker ( node : Node ) : void {
1611
1611
const parent = node . parent ;
1612
+ if ( parent && ( parent . kind === SyntaxKind . PropertyAssignment || getNestedModuleDeclaration ( parent ) ) ) {
1613
+ getJSDocCommentsAndTagsWorker ( parent ) ;
1614
+ }
1612
1615
// Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement.
1613
1616
// /**
1614
1617
// * @param {number } name
1615
1618
// * @returns {number }
1616
1619
// */
1617
1620
// var x = function(name) { return name.length; }
1618
- if ( parent && ( parent . kind === SyntaxKind . PropertyAssignment || getNestedModuleDeclaration ( parent ) ) ) {
1619
- getJSDocCommentsAndTagsWorker ( parent ) ;
1620
- }
1621
1621
if ( parent && parent . parent &&
1622
1622
( getSingleVariableOfVariableStatement ( parent . parent , node ) || getSourceOfAssignment ( parent . parent ) ) ) {
1623
1623
getJSDocCommentsAndTagsWorker ( parent . parent ) ;
1624
1624
}
1625
1625
if ( parent && parent . parent && parent . parent . parent && getSingleInitializerOfVariableStatement ( parent . parent . parent , node ) ) {
1626
1626
getJSDocCommentsAndTagsWorker ( parent . parent . parent ) ;
1627
1627
}
1628
+ if ( isBinaryExpression ( node ) && getSpecialPropertyAssignmentKind ( node ) !== SpecialPropertyAssignmentKind . None ) {
1629
+ getJSDocCommentsAndTagsWorker ( parent ) ;
1630
+ }
1628
1631
1629
1632
// Pull parameter comments from declaring function as well
1630
1633
if ( node . kind === SyntaxKind . Parameter ) {
0 commit comments