diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 040877394cc..28faf0c2fda 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1597,7 +1597,7 @@ namespace ts { : createSynthesizedNode(node.kind); for (const key in node) { - if (isExcludedPropertyForClone(key) || !node.hasOwnProperty(key)) { + if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) { continue; } @@ -1615,13 +1615,6 @@ namespace ts { return clone; } - function isExcludedPropertyForClone(property: string) { - return property === "pos" - || property === "end" - || property === "flags" - || property === "parent"; - } - /** * Creates a deep clone of an EntityName, with new parent pointers. * @param node The EntityName to clone.