[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
@@ -74,9 +74,6 @@ class FilePathsInKlibTest : CodegenTestCase() {
|
||||
module.getModuleDescriptor(it)
|
||||
}
|
||||
|
||||
val metadataSerializer =
|
||||
KlibMetadataIncrementalSerializer(module.compilerConfiguration, module.project, module.jsFrontEndResult.hasErrors)
|
||||
|
||||
val diagnosticReporter = DiagnosticReporterFactory.createPendingReporter()
|
||||
generateKLib(
|
||||
module,
|
||||
@@ -85,10 +82,8 @@ class FilePathsInKlibTest : CodegenTestCase() {
|
||||
jsOutputName = MODULE_NAME,
|
||||
icData = icData,
|
||||
moduleFragment = moduleFragment,
|
||||
diagnosticReporter = diagnosticReporter
|
||||
) { file ->
|
||||
metadataSerializer.serializeScope(file, module.jsFrontEndResult.bindingContext, moduleFragment.descriptor)
|
||||
}
|
||||
diagnosticReporter = diagnosticReporter,
|
||||
)
|
||||
}
|
||||
|
||||
private fun setupEnvironment(): CompilerConfiguration {
|
||||
|
||||
Reference in New Issue
Block a user