[JS] Support evaluation of const intrinsics for K2

#KT-56023 Fixed
#KT-51582 Fixed
This commit is contained in:
Ivan Kylchik
2023-02-08 14:40:58 +01:00
committed by Space Team
parent e981b1f958
commit 7cf9dda8dc
36 changed files with 413 additions and 40 deletions
@@ -20,10 +20,10 @@ import org.jetbrains.kotlin.ir.interpreter.checker.IrConstTransformer
class ConstEvaluationLowering(
val context: CommonBackendContext,
private val suppressErrors: Boolean = context.configuration.getBoolean(CommonConfigurationKeys.IGNORE_CONST_OPTIMIZATION_ERRORS),
configuration: IrInterpreterConfiguration = IrInterpreterConfiguration(printOnlyExceptionMessage = true),
private val onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit = { _, _, _ -> },
private val onError: (IrFile, IrElement, IrErrorExpression) -> Unit = { _, _, _ -> },
) : FileLoweringPass {
val configuration = IrInterpreterConfiguration(printOnlyExceptionMessage = true)
val interpreter = IrInterpreter(IrInterpreterEnvironment(context.irBuiltIns, configuration), emptyMap())
override fun lower(irFile: IrFile) {