diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 7d703ffe062..fe183c5e806 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -71,16 +71,6 @@ namespace ts { return clone; } - /** - * Creates a deep, memberwise clone of a node with no source map location. - */ - /* @internal */ - export function getSynthesizedDeepClone(node: T | undefined): T | undefined { - return node - ? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext)) - : undefined; - } - // Literals export function createLiteral(value: string): StringLiteral; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 6166ceea28c..c22b981b4ff 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1334,4 +1334,16 @@ namespace ts { } return position; } + + /** + * Creates a deep, memberwise clone of a node with no source map location. + * + * WARNING: This is an expensive operation and is only intended to be used in refactorings + * and code fixes (because those are triggered by explicit user actions). + */ + export function getSynthesizedDeepClone(node: T | undefined): T | undefined { + return node + ? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext)) + : undefined; + } }