[K/JS] Add support of compilation with ES-classes

This commit is contained in:
Artem Kobzar
2023-01-17 18:14:17 +00:00
committed by Space Team
parent 8d728d4f53
commit 71486a321c
239 changed files with 57567 additions and 1658 deletions
@@ -5,8 +5,6 @@
package org.jetbrains.kotlin.ir.expressions
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOriginImpl
abstract class IrStatementOriginImpl(val debugName: String) : IrStatementOrigin {
override fun toString(): String = debugName
}
@@ -205,6 +205,12 @@ val IrProperty.isSimpleProperty: Boolean
val IrClass.functions: Sequence<IrSimpleFunction>
get() = declarations.asSequence().filterIsInstance<IrSimpleFunction>()
val IrClass.superClass: IrClass?
get() = superTypes
.firstOrNull { !it.isInterface() && !it.isAny() }
?.classOrNull
?.owner
val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol>
get() = owner.functions.map { it.symbol }
@@ -823,8 +829,11 @@ fun IrFunction.copyValueParametersFrom(from: IrFunction, substitutionMap: Map<Ir
fun IrFunction.copyParameterDeclarationsFrom(from: IrFunction) {
assert(typeParameters.isEmpty())
copyTypeParametersFrom(from)
val substitutionMap = makeTypeParameterSubstitutionMap(from, this)
copyValueParametersFrom(from, substitutionMap)
copyValueParametersFrom(from)
}
fun IrFunction.copyValueParametersFrom(from: IrFunction) {
copyValueParametersFrom(from, makeTypeParameterSubstitutionMap(from, this))
}
fun IrTypeParametersContainer.copyTypeParameters(