[klib] Don't pass around metadata serialization closure
Pass the metadata serializer instance instead. This allows to further reduce code duplication by introducing the common interface `KlibSingleFileMetadataSerializer` for abstracting away K1 and K2 representation of a source file, as well as reusing `Fir2KlibMetadataSerializer` across different backends. KT-64392
This commit is contained in:
committed by
Space Team
parent
5a6f51e474
commit
f39335b3f7
@@ -106,10 +106,6 @@ abstract class IrAbstractInvalidationTest(
|
||||
) {
|
||||
sourceModule.getModuleDescriptor(it)
|
||||
}
|
||||
val metadataSerializer =
|
||||
KlibMetadataIncrementalSerializer(configuration, sourceModule.project, sourceModule.jsFrontEndResult.hasErrors)
|
||||
|
||||
val diagnosticReporter = DiagnosticReporterFactory.createPendingReporter()
|
||||
generateKLib(
|
||||
sourceModule,
|
||||
outputKlibFile.canonicalPath,
|
||||
@@ -117,9 +113,7 @@ abstract class IrAbstractInvalidationTest(
|
||||
jsOutputName = moduleName,
|
||||
icData = icData,
|
||||
moduleFragment = moduleFragment,
|
||||
diagnosticReporter = diagnosticReporter
|
||||
) { file ->
|
||||
metadataSerializer.serializeScope(file, sourceModule.jsFrontEndResult.bindingContext, moduleFragment.descriptor)
|
||||
}
|
||||
diagnosticReporter = DiagnosticReporterFactory.createPendingReporter(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user