File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2503,8 +2503,9 @@ namespace ts {
2503
2503
helpers
2504
2504
} = sourceEmitNode ;
2505
2505
if ( ! destEmitNode ) destEmitNode = { } ;
2506
- if ( leadingComments ) destEmitNode . leadingComments = concatenate ( leadingComments , destEmitNode . leadingComments ) ;
2507
- if ( trailingComments ) destEmitNode . trailingComments = concatenate ( trailingComments , destEmitNode . trailingComments ) ;
2506
+ // We are using `.slice()` here in case `destEmitNode.leadingComments` is pushed to later.
2507
+ if ( leadingComments ) destEmitNode . leadingComments = addRange ( leadingComments . slice ( ) , destEmitNode . leadingComments ) ;
2508
+ if ( trailingComments ) destEmitNode . trailingComments = addRange ( trailingComments . slice ( ) , destEmitNode . trailingComments ) ;
2508
2509
if ( flags ) destEmitNode . flags = flags ;
2509
2510
if ( commentRange ) destEmitNode . commentRange = commentRange ;
2510
2511
if ( sourceMapRange ) destEmitNode . sourceMapRange = sourceMapRange ;
You can’t perform that action at this time.
0 commit comments