Skip to content

Commit 44568f7

Browse files
author
Armando Aguirre Sepulveda
committed
Change appendIfUnique for overwriting
1 parent 9092688 commit 44568f7

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.vscode/tasks.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
"label": "tsc: watch ./src",
2626
"type": "shell",
2727
"command": "node",
28-
"args": ["${workspaceFolder}/node_modules/typescript/lib/tsc.js", "--build", "${workspaceFolder}/src", "--watch"],
28+
"args": [
29+
"${workspaceFolder}/node_modules/typescript/lib/tsc.js",
30+
"--build",
31+
"${workspaceFolder}/src",
32+
"--watch"
33+
],
2934
"group": "build",
3035
"isBackground": true,
3136
"problemMatcher": [
@@ -36,7 +41,10 @@
3641
"label": "npm: build:compiler",
3742
"type": "npm",
3843
"script": "build:compiler",
39-
"group": "build",
44+
"group": {
45+
"kind": "build",
46+
"isDefault": true
47+
},
4048
"problemMatcher": [
4149
"$tsc"
4250
]

src/compiler/factory/nodeFactory.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7445,20 +7445,16 @@ function mergeEmitNode(sourceEmitNode: EmitNode, destEmitNode: EmitNode | undefi
74457445

74467446
// `annotatedNodes` are not merged as they should only present on the parse tree node of a `SourceFile`.
74477447

7448-
// `leadingComments` are concatenated with any existing leading comments on the destination
7448+
// `leadingComments` overwrites the destination
74497449
if (leadingComments) {
74507450
// We use `.slice()` in case `destEmitNode.leadingComments` is pushed to later
7451-
for (const comment of leadingComments.slice()) {
7452-
destEmitNode.leadingComments = appendIfUnique(destEmitNode.leadingComments, comment);
7453-
}
7451+
destEmitNode.leadingComments = leadingComments.slice();
74547452
}
74557453

7456-
// `trailingComments` are concatenated with any existing trailing comments on the destination
7454+
// `trailingComments` overwrites the destination
74577455
if (trailingComments) {
74587456
// We use `.slice()` in case `destEmitNode.trailingComments` is pushed to later
7459-
for (const comment of trailingComments) {
7460-
destEmitNode.trailingComments = appendIfUnique(destEmitNode.trailingComments, comment);
7461-
}
7457+
destEmitNode.trailingComments = trailingComments.slice();
74627458
}
74637459

74647460
// `commentRange` overwrites the destination

0 commit comments

Comments
 (0)