Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cbdf02f

Browse filesBrowse files
author
Andy
authored
Undo change and go back to making a copy of leadingComments and trailingComments (microsoft#16273)
1 parent d9ec08c commit cbdf02f
Copy full SHA for cbdf02f

1 file changed

+3-2Lines changed: 3 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/factory.ts‎

Copy file name to clipboardExpand all lines: src/compiler/factory.ts
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,8 +2503,9 @@ namespace ts {
25032503
helpers
25042504
} = sourceEmitNode;
25052505
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);
25082509
if (flags) destEmitNode.flags = flags;
25092510
if (commentRange) destEmitNode.commentRange = commentRange;
25102511
if (sourceMapRange) destEmitNode.sourceMapRange = sourceMapRange;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.