From 219f1b01663650da7a1b9208378ea41627fa6049 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 12 Apr 2016 14:15:41 -0700 Subject: [PATCH] Fix the name when synthesized node is clone of auto generate identifier kind This fixes variable declaration created for default exported class without name Fixes #7875 --- src/compiler/printer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/printer.ts b/src/compiler/printer.ts index f39793a80af..398908edd82 100644 --- a/src/compiler/printer.ts +++ b/src/compiler/printer.ts @@ -2607,8 +2607,10 @@ const _super = (function (geti, seti) { function getSourceNodeForGeneratedName(name: Identifier) { let node: Node = name; while (node.original !== undefined) { + const nodeId = node.id; node = node.original; - if (isIdentifier(node) && node.autoGenerateKind === GeneratedIdentifierKind.Node) { + // If this is not the exact clone of identifier use this identifier to generate the name + if (isIdentifier(node) && node.autoGenerateKind === GeneratedIdentifierKind.Node && node.id !== nodeId) { break; } }