[K/JS] Add support of compilation with ES-classes
This commit is contained in:
+11
@@ -291,6 +291,17 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var strictImplicitExportType: Boolean by FreezableVar(false)
|
||||
|
||||
@GradleOption(
|
||||
value = DefaultValue.BOOLEAN_FALSE_DEFAULT,
|
||||
gradleInputType = GradleInputTypes.INPUT,
|
||||
shouldGenerateDeprecatedKotlinOptions = true,
|
||||
)
|
||||
@Argument(
|
||||
value = "-Xes-classes",
|
||||
description = "Generated JavaScript will use ES2015 classes."
|
||||
)
|
||||
var useEsClasses: Boolean by FreezableVar(false)
|
||||
|
||||
@GradleOption(
|
||||
value = DefaultValue.BOOLEAN_TRUE_DEFAULT,
|
||||
gradleInputType = GradleInputTypes.INPUT,
|
||||
|
||||
@@ -144,7 +144,8 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
arguments.irSafeExternalBooleanDiagnostic,
|
||||
messageCollector
|
||||
),
|
||||
granularity = arguments.granularity
|
||||
granularity = arguments.granularity,
|
||||
es6mode = arguments.useEsClasses
|
||||
)
|
||||
}
|
||||
|
||||
@@ -668,7 +669,14 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
compilerConfiguration = configurationJs,
|
||||
irFactory = { IrFactoryImplForJsIC(WholeWorldStageController()) },
|
||||
mainArguments = mainCallArguments,
|
||||
compilerInterfaceFactory = { mainModule, cfg -> JsIrCompilerWithIC(mainModule, cfg, arguments.granularity) }
|
||||
compilerInterfaceFactory = { mainModule, cfg ->
|
||||
JsIrCompilerWithIC(
|
||||
mainModule,
|
||||
cfg,
|
||||
arguments.granularity,
|
||||
es6mode = arguments.useEsClasses
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
val artifacts = cacheUpdater.actualizeCaches()
|
||||
|
||||
Reference in New Issue
Block a user