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,