mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-26 21:23:53 -06:00
Modified cloneNode to ignore own properties of clone.
This commit is contained in:
parent
68c292c445
commit
0ee4e0b10d
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user