mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Added an assertion to ensure export assignments for expression statements are only emitted for decorated clases.
This commit is contained in:
parent
482dfb61be
commit
bce1a06c08
@ -707,11 +707,14 @@ namespace ts {
|
||||
return visitExpressionStatementForEnumOrNamespaceDeclaration(node, <EnumDeclaration | ModuleDeclaration>original);
|
||||
}
|
||||
else if (origKind === SyntaxKind.ClassDeclaration) {
|
||||
// The decorated assignment for a class name will need to be transformed.
|
||||
// The decorated assignment for a class name will potentially need to be transformed.
|
||||
const classDecl = original as ClassDeclaration;
|
||||
if (classDecl.name) {
|
||||
const statements = [node];
|
||||
addExportMemberAssignments(statements, classDecl.name);
|
||||
if (statements.length > 1) {
|
||||
Debug.assert(!!classDecl.decorators, "Expression statements should only have an export member assignment when decorated.")
|
||||
}
|
||||
return statements;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user