Skip to content

Commit 3dd3401

Browse files
Correct export assignments for when the variable declaration has an export modifier.
1 parent 0409c24 commit 3dd3401

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/compiler/transformers/module/module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,13 @@ namespace ts {
717717
const classDecl = original as ClassDeclaration;
718718
if (classDecl.name) {
719719
const statements = [node];
720+
// Avoid emitting a default because that will typically be taken care of for us.
721+
if (hasModifier(classDecl, ModifierFlags.Export) && !hasModifier(classDecl, ModifierFlags.Default)) {
722+
addExportMemberAssignment(statements, classDecl)
723+
}
724+
720725
addExportMemberAssignments(statements, classDecl.name);
726+
721727
if (statements.length > 1) {
722728
Debug.assert(!!classDecl.decorators, "Expression statements should only have an export member assignment when decorated.")
723729
}

0 commit comments

Comments
 (0)