From 7a6415dc5362095fcba7ad13f10e191e7b8c0b55 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Tue, 1 Sep 2020 12:19:02 +0300 Subject: [PATCH] [JS IR] Enable IrError element's lowerings in JS --- .../kotlin/ir/backend/js/JsLoweringPhases.kt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt index eb23c81bae4..113211a6120 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt @@ -514,6 +514,19 @@ private val multipleCatchesLoweringPhase = makeBodyLoweringPhase( description = "Replace multiple catches with single one" ) +private val errorExpressionLoweringPhase = makeBodyLoweringPhase( + ::JsErrorExpressionLowering, + name = "errorExpressionLoweringPhase", + description = "Transform error expressions into simple ir code", + prerequisite = setOf(multipleCatchesLoweringPhase) +) + +private val errorDeclarationLoweringPhase = makeDeclarationTransformerPhase( + ::JsErrorDeclarationLowering, + name = "errorDeclarationLoweringPhase", + description = "Transform error declarations into simple ir code" +) + private val bridgesConstructionPhase = makeDeclarationTransformerPhase( ::BridgesConstruction, name = "BridgesConstruction", @@ -534,7 +547,7 @@ private val typeOperatorLoweringPhase = makeBodyLoweringPhase( prerequisite = setOf( bridgesConstructionPhase, removeInlineFunctionsWithReifiedTypeParametersLoweringPhase, - singleAbstractMethodPhase + singleAbstractMethodPhase, errorExpressionLoweringPhase ) ) @@ -707,6 +720,8 @@ val loweringList = listOf( es6ConstructorLowering, varargLoweringPhase, multipleCatchesLoweringPhase, + errorExpressionLoweringPhase, + errorDeclarationLoweringPhase, bridgesConstructionPhase, typeOperatorLoweringPhase, secondaryConstructorLoweringPhase,