ModuleDescriptorImpl: remove KBI as default parameter
This commit is contained in:
@@ -40,27 +40,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public final class TopDownAnalyzerFacadeForJS {
|
||||
public static final List<ImportPath> DEFAULT_IMPORTS = ImmutableList.of(
|
||||
new ImportPath("java.lang.*"),
|
||||
new ImportPath("kotlin.*"),
|
||||
new ImportPath("kotlin.annotation.*"),
|
||||
new ImportPath("kotlin.js.*")
|
||||
);
|
||||
|
||||
public static ModuleParameters JS_MODULE_PARAMETERS = new ModuleParameters() {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<ImportPath> getDefaultImports() {
|
||||
return DEFAULT_IMPORTS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PlatformToKotlinClassMap getPlatformToKotlinClassMap() {
|
||||
return PlatformToKotlinClassMap.EMPTY;
|
||||
}
|
||||
};
|
||||
|
||||
private TopDownAnalyzerFacadeForJS() {
|
||||
}
|
||||
|
||||
@@ -72,7 +51,7 @@ public final class TopDownAnalyzerFacadeForJS {
|
||||
BindingTrace trace = new BindingTraceContext();
|
||||
|
||||
MutableModuleContext newModuleContext = ContextPackage.ContextForNewModule(
|
||||
config.getProject(), Name.special("<" + config.getModuleId() + ">"), JS_MODULE_PARAMETERS
|
||||
config.getProject(), Name.special("<" + config.getModuleId() + ">"), JsPlatform.INSTANCE$
|
||||
);
|
||||
newModuleContext.setDependencies(computeDependencies(newModuleContext.getModule(), config));
|
||||
return analyzeFilesWithGivenTrace(files, trace, newModuleContext, config);
|
||||
|
||||
@@ -26,10 +26,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentProvider;
|
||||
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl;
|
||||
import org.jetbrains.kotlin.js.analyze.TopDownAnalyzerFacadeForJS;
|
||||
import org.jetbrains.kotlin.js.resolve.JsPlatform;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.psi.JetFile;
|
||||
import org.jetbrains.kotlin.resolve.TargetPlatformKt;
|
||||
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil;
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
|
||||
import org.jetbrains.kotlin.utils.KotlinJavascriptMetadata;
|
||||
@@ -152,9 +152,8 @@ public abstract class Config {
|
||||
"expected abi version " + KotlinJavascriptMetadataUtils.ABI_VERSION +
|
||||
", but metadata.abiVersion = " + metadata.getAbiVersion();
|
||||
|
||||
ModuleDescriptorImpl moduleDescriptor = new ModuleDescriptorImpl(
|
||||
Name.special("<" + metadata.getModuleName() + ">"), storageManager,
|
||||
TopDownAnalyzerFacadeForJS.JS_MODULE_PARAMETERS
|
||||
ModuleDescriptorImpl moduleDescriptor = TargetPlatformKt.createModule(
|
||||
JsPlatform.INSTANCE$, Name.special("<" + metadata.getModuleName() + ">"), storageManager
|
||||
);
|
||||
|
||||
PackageFragmentProvider provider =
|
||||
|
||||
@@ -16,10 +16,26 @@
|
||||
|
||||
package org.jetbrains.kotlin.js.resolve
|
||||
|
||||
import com.google.common.collect.ImmutableList
|
||||
import org.jetbrains.kotlin.descriptors.ModuleParameters
|
||||
import org.jetbrains.kotlin.platform.PlatformToKotlinClassMap
|
||||
import org.jetbrains.kotlin.resolve.ImportPath
|
||||
import org.jetbrains.kotlin.resolve.PlatformConfigurator
|
||||
import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||
import org.jetbrains.kotlin.types.DynamicTypesAllowed
|
||||
|
||||
public object JsPlatform : TargetPlatform("JS") {
|
||||
override val defaultModuleParameters = object : ModuleParameters {
|
||||
override val defaultImports: List<ImportPath> = ImmutableList.of(
|
||||
ImportPath("java.lang.*"),
|
||||
ImportPath("kotlin.*"),
|
||||
ImportPath("kotlin.annotation.*"),
|
||||
ImportPath("kotlin.js.*")
|
||||
)
|
||||
|
||||
override val platformToKotlinClassMap: PlatformToKotlinClassMap
|
||||
get() = PlatformToKotlinClassMap.EMPTY
|
||||
}
|
||||
|
||||
|
||||
override val platformConfigurator: PlatformConfigurator = JsPlatformConfigurator
|
||||
}
|
||||
Reference in New Issue
Block a user