From 74dd99a8da19e8cb5cd9925e15b70d8b677ac5c4 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 25 Jan 2019 16:01:33 +0100 Subject: [PATCH] JS: use new DefaultBuiltIns instance instead of anonymous --- .../kotlin/js/analyze/TopDownAnalyzerFacadeForJS.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/analyze/TopDownAnalyzerFacadeForJS.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/analyze/TopDownAnalyzerFacadeForJS.kt index 4b8024a32cb..e20a6ceedf3 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/analyze/TopDownAnalyzerFacadeForJS.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/analyze/TopDownAnalyzerFacadeForJS.kt @@ -6,7 +6,7 @@ package org.jetbrains.kotlin.js.analyze import com.intellij.openapi.project.Project -import org.jetbrains.kotlin.builtins.KotlinBuiltIns +import org.jetbrains.kotlin.builtins.DefaultBuiltIns import org.jetbrains.kotlin.builtins.functions.functionInterfacePackageFragmentProvider import org.jetbrains.kotlin.config.CommonConfigurationKeys import org.jetbrains.kotlin.config.CompilerConfiguration @@ -55,17 +55,16 @@ object TopDownAnalyzerFacadeForJS { require(!thisIsBuiltInsModule || customBuiltInsModule == null) { "Can't simultaneously use custom built-ins module and set current module as built-ins" } - val projectContext = ProjectContext(project) val builtIns = when { - thisIsBuiltInsModule -> object : KotlinBuiltIns(projectContext.storageManager) {} + thisIsBuiltInsModule -> DefaultBuiltIns(loadBuiltInsFromCurrentClassLoader = false) customBuiltInsModule != null -> customBuiltInsModule.builtIns else -> JsPlatform.builtIns } val moduleName = configuration[CommonConfigurationKeys.MODULE_NAME]!! val context = ContextForNewModule( - projectContext, + ProjectContext(project), Name.special("<$moduleName>"), builtIns, multiTargetPlatform = null