[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 =
|
||||
|
||||
+2
@@ -3,6 +3,8 @@ where advanced options include:
|
||||
-Xcache-directories=<path> A path to cache directories
|
||||
-Xenable-js-scripting Enable experimental support of .kts files using K/JS (with -Xir only)
|
||||
-Xerror-tolerance-policy Set up error tolerance policy (NONE, SEMANTIC, SYNTAX, ALL)
|
||||
-Xenable-extension-functions-in-externals
|
||||
Enable extensions functions members in external interfaces
|
||||
-Xfake-override-validator Enable IR fake override validator
|
||||
-Xfriend-modules=<path> Paths to friend modules
|
||||
-Xfriend-modules-disabled Disable internal declaration export
|
||||
|
||||
Reference in New Issue
Block a user