@@ -440,7 +440,14 @@ namespace ts {
440440
441441 /* @internal */
442442 export function parseIsolatedJSDocComment ( content : string , start ?: number , length ?: number ) {
443- return Parser . JSDocParser . parseIsolatedJSDocComment ( content , start , length ) ;
443+ const result = Parser . JSDocParser . parseIsolatedJSDocComment ( content , start , length ) ;
444+ if ( result && result . jsDocComment ) {
445+ // because the jsDocComment was parsed out of the source file, it might
446+ // not be covered by the fixupParentReferences.
447+ Parser . fixupParentReferences ( result . jsDocComment ) ;
448+ }
449+
450+ return result ;
444451 }
445452
446453 /* @internal */
@@ -652,14 +659,14 @@ namespace ts {
652659 return node ;
653660 }
654661
655- export function fixupParentReferences ( sourceFile : Node ) {
662+ export function fixupParentReferences ( rootNode : Node ) {
656663 // normally parent references are set during binding. However, for clients that only need
657664 // a syntax tree, and no semantic features, then the binding process is an unnecessary
658665 // overhead. This functions allows us to set all the parents, without all the expense of
659666 // binding.
660667
661- let parent : Node = sourceFile ;
662- forEachChild ( sourceFile , visitNode ) ;
668+ let parent : Node = rootNode ;
669+ forEachChild ( rootNode , visitNode ) ;
663670 return ;
664671
665672 function visitNode ( n : Node ) : void {
0 commit comments