@@ -7013,7 +7013,7 @@ namespace ts {
70137013 forEachChild ( node , visitNode , visitArray ) ;
70147014 if ( hasJSDocNodes ( node ) ) {
70157015 for ( const jsDocComment of node . jsDoc ) {
7016- forEachChild ( jsDocComment , visitNode , visitArray ) ;
7016+ visitNode ( < IncrementalNode > < Node > jsDocComment ) ;
70177017 }
70187018 }
70197019 checkNodePositions ( node , aggressiveChecks ) ;
@@ -7119,10 +7119,16 @@ namespace ts {
71197119 function checkNodePositions ( node : Node , aggressiveChecks : boolean ) {
71207120 if ( aggressiveChecks ) {
71217121 let pos = node . pos ;
7122- forEachChild ( node , child => {
7122+ const visitNode = ( child : Node ) => {
71237123 Debug . assert ( child . pos >= pos ) ;
71247124 pos = child . end ;
7125- } ) ;
7125+ } ;
7126+ if ( hasJSDocNodes ( node ) ) {
7127+ for ( const jsDocComment of node . jsDoc ) {
7128+ visitNode ( jsDocComment ) ;
7129+ }
7130+ }
7131+ forEachChild ( node , visitNode ) ;
71267132 Debug . assert ( pos <= node . end ) ;
71277133 }
71287134 }
@@ -7160,7 +7166,11 @@ namespace ts {
71607166 // Adjust the pos or end (or both) of the intersecting element accordingly.
71617167 adjustIntersectingElement ( child , changeStart , changeRangeOldEnd , changeRangeNewEnd , delta ) ;
71627168 forEachChild ( child , visitNode , visitArray ) ;
7163-
7169+ if ( hasJSDocNodes ( child ) ) {
7170+ for ( const jsDocComment of child . jsDoc ) {
7171+ visitNode ( < IncrementalNode > < Node > jsDocComment ) ;
7172+ }
7173+ }
71647174 checkNodePositions ( child , aggressiveChecks ) ;
71657175 return ;
71667176 }
0 commit comments