[K/JS, TEST] Enable TS export tests for FIR ^KT-64421 Fixed
This commit is contained in:
+4
-3
@@ -303,6 +303,7 @@ class ExportModelGenerator(val context: JsIrBackendContext, val generateNamespac
|
||||
specialProcessing: (IrDeclarationWithName) -> ExportedDeclaration? = { null }
|
||||
): ExportedClassDeclarationsInfo {
|
||||
val members = mutableListOf<ExportedDeclaration>()
|
||||
val specialMembers = mutableListOf<ExportedDeclaration>()
|
||||
val nestedClasses = mutableListOf<ExportedClass>()
|
||||
val isImplicitlyExportedClass = klass.isJsImplicitExport()
|
||||
|
||||
@@ -314,7 +315,7 @@ class ExportModelGenerator(val context: JsIrBackendContext, val generateNamespac
|
||||
|
||||
val processingResult = specialProcessing(candidate)
|
||||
if (processingResult != null) {
|
||||
members.add(processingResult)
|
||||
specialMembers.add(processingResult)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -362,7 +363,7 @@ class ExportModelGenerator(val context: JsIrBackendContext, val generateNamespac
|
||||
}
|
||||
|
||||
return ExportedClassDeclarationsInfo(
|
||||
members,
|
||||
specialMembers + members,
|
||||
nestedClasses
|
||||
)
|
||||
}
|
||||
@@ -496,7 +497,7 @@ class ExportModelGenerator(val context: JsIrBackendContext, val generateNamespac
|
||||
"ordinal" -> enumEntriesToOrdinal
|
||||
.map { (_, ordinal) -> ExportedType.LiteralType.NumberLiteralType(ordinal) }
|
||||
.reduce { acc: ExportedType, s: ExportedType -> ExportedType.UnionType(acc, s) }
|
||||
else -> null
|
||||
else -> return null
|
||||
}
|
||||
exportPropertyUnsafely(
|
||||
candidate,
|
||||
|
||||
+2
-1
@@ -300,7 +300,8 @@ class ExportModelToTsDeclarations {
|
||||
|
||||
val (innerClasses, nonInnerClasses) = nestedDeclarations.partition { it.ir.isInner }
|
||||
val innerClassesProperties = innerClasses.map { it.toReadonlyProperty() }
|
||||
val membersString = (members + innerClassesProperties).joinToString("") { it.toTypeScript("$indent ") + "\n" }
|
||||
val membersString = (members + innerClassesProperties)
|
||||
.joinToString("") { it.toTypeScript("$indent ") + "\n" }
|
||||
|
||||
// If there are no exported constructors, add a private constructor to disable default one
|
||||
val privateCtorString = if (!isInterface && !isAbstract && members.none { it is ExportedConstructor }) {
|
||||
|
||||
Reference in New Issue
Block a user