From 0ee4e0b10dd964ec97ebd8434195e436f4021dd7 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 20 Nov 2015 10:13:01 -0800 Subject: [PATCH] Modified cloneNode to ignore own properties of clone. --- src/compiler/utilities.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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.