visitNodesWithoutCopyingPositions always makes a new NodeArray (#59137)

This commit is contained in:
Isabel Duan
2024-07-17 05:50:17 +09:00
committed by GitHub
parent 0206f9fa6e
commit 66a762f59d
2 changed files with 39 additions and 1 deletions
+1 -1
View File
@@ -8966,7 +8966,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (result) {
if (result.pos !== -1 || result.end !== -1) {
if (result === nodes) {
result = factory.createNodeArray(nodes, nodes.hasTrailingComma);
result = factory.createNodeArray(nodes.slice(), nodes.hasTrailingComma);
}
setTextRangePosEnd(result, -1, -1);
}