Skip to content

Commit 0ee4e0b

Browse files
committed
Modified cloneNode to ignore own properties of clone.
1 parent 68c292c commit 0ee4e0b

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/compiler/utilities.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ namespace ts {
15971597
: <T>createSynthesizedNode(node.kind);
15981598

15991599
for (const key in node) {
1600-
if (isExcludedPropertyForClone(key) || !node.hasOwnProperty(key)) {
1600+
if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) {
16011601
continue;
16021602
}
16031603

@@ -1615,13 +1615,6 @@ namespace ts {
16151615
return clone;
16161616
}
16171617

1618-
function isExcludedPropertyForClone(property: string) {
1619-
return property === "pos"
1620-
|| property === "end"
1621-
|| property === "flags"
1622-
|| property === "parent";
1623-
}
1624-
16251618
/**
16261619
* Creates a deep clone of an EntityName, with new parent pointers.
16271620
* @param node The EntityName to clone.

0 commit comments

Comments
 (0)