mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
Add handleing for classes
This commit is contained in:
@@ -5559,7 +5559,11 @@ const _super = (function (geti, seti) {
|
||||
}
|
||||
|
||||
function emitClassLikeDeclarationBelowES6(node: ClassLikeDeclaration) {
|
||||
const isES6ExportedClass = isES6ExportedDeclaration(node);
|
||||
if (node.kind === SyntaxKind.ClassDeclaration) {
|
||||
if (isES6ExportedClass && !(node.flags & NodeFlags.Default)) {
|
||||
write("export ");
|
||||
}
|
||||
// source file level classes in system modules are hoisted so 'var's for them are already defined
|
||||
if (!shouldHoistDeclarationInSystemJsModule(node)) {
|
||||
write("var ");
|
||||
@@ -5629,9 +5633,15 @@ const _super = (function (geti, seti) {
|
||||
}
|
||||
emitEnd(node);
|
||||
|
||||
if (node.kind === SyntaxKind.ClassDeclaration) {
|
||||
if (node.kind === SyntaxKind.ClassDeclaration && !isES6ExportedClass) {
|
||||
emitExportMemberAssignment(<ClassDeclaration>node);
|
||||
}
|
||||
else if (isES6ExportedClass && (node.flags & NodeFlags.Default)) {
|
||||
writeLine();
|
||||
write("export default ");
|
||||
emitDeclarationName(node);
|
||||
write(";");
|
||||
}
|
||||
}
|
||||
|
||||
function emitClassMemberPrefix(node: ClassLikeDeclaration, member: Node) {
|
||||
|
||||
Reference in New Issue
Block a user