[JS IR] Add separate key to enable extensions in external interfaces
This commit is contained in:
+15
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.*
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||
import org.jetbrains.kotlin.config.ApiVersion
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.LanguageVersion
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
|
||||
@@ -214,6 +215,12 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var friendModules: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@Argument(
|
||||
value = "-Xenable-extension-functions-in-externals",
|
||||
description = "Enable extensions functions members in external interfaces"
|
||||
)
|
||||
var extensionFunctionsInExternals: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(value = "-Xmetadata-only", description = "Generate *.meta.js and *.kjsm files only")
|
||||
var metadataOnly: Boolean by FreezableVar(false)
|
||||
|
||||
@@ -241,6 +248,14 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun configureLanguageFeatures(collector: MessageCollector): MutableMap<LanguageFeature, LanguageFeature.State> {
|
||||
return super.configureLanguageFeatures(collector).apply {
|
||||
if (extensionFunctionsInExternals) {
|
||||
this[LanguageFeature.JsEnableExtensionFunctionInExternals] = LanguageFeature.State.ENABLED
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun K2JSCompilerArguments.isPreIrBackendDisabled(): Boolean =
|
||||
|
||||
Reference in New Issue
Block a user