diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index fe183c5e80..84c28abe1a 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -71,6 +71,15 @@ namespace ts { return clone; } + /** + * Creates a deep, memberwise clone of a node with no source map location. + */ + 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;