Search in sources :

Example 1 with CompilerDeserializationConfiguration

use of org.jetbrains.kotlin.resolve.CompilerDeserializationConfiguration in project kotlin by JetBrains.

the class JsConfig method createModuleDescriptor.

private JsModuleDescriptor<ModuleDescriptorImpl> createModuleDescriptor(KotlinJavascriptMetadata metadata) {
    assert metadata.getVersion().isCompatible() : "Expected JS metadata version " + JsMetadataVersion.INSTANCE + ", but actual metadata version is " + metadata.getVersion();
    ModuleDescriptorImpl moduleDescriptor = new ModuleDescriptorImpl(Name.special("<" + metadata.getModuleName() + ">"), storageManager, JsPlatform.INSTANCE.getBuiltIns());
    JsModuleDescriptor<PackageFragmentProvider> rawDescriptor = KotlinJavascriptSerializationUtil.readModule(metadata.getBody(), storageManager, moduleDescriptor, new CompilerDeserializationConfiguration(CommonConfigurationKeysKt.getLanguageVersionSettings(configuration)));
    PackageFragmentProvider provider = rawDescriptor.getData();
    moduleDescriptor.initialize(provider != null ? provider : PackageFragmentProvider.Empty.INSTANCE);
    return rawDescriptor.copy(moduleDescriptor);
}
Also used : CompilerDeserializationConfiguration(org.jetbrains.kotlin.resolve.CompilerDeserializationConfiguration) PackageFragmentProvider(org.jetbrains.kotlin.descriptors.PackageFragmentProvider) ModuleDescriptorImpl(org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl)

Aggregations

PackageFragmentProvider (org.jetbrains.kotlin.descriptors.PackageFragmentProvider)1 ModuleDescriptorImpl (org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl)1 CompilerDeserializationConfiguration (org.jetbrains.kotlin.resolve.CompilerDeserializationConfiguration)1