Modified cloneNode to ignore own properties of clone.

This commit is contained in:
Ron Buckton 2015-11-20 10:13:01 -08:00
parent 68c292c445
commit 0ee4e0b10d

View File

@ -1597,7 +1597,7 @@ namespace ts {
: <T>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.