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
This commit is contained in:
Sheetal Nandi 2016-04-12 14:15:41 -07:00
parent 5e308b9b9a
commit 219f1b0166

View File

@ -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;
}
}