[JS BE] Set enclosing exception state in finally block
[Fix KT-28207]
This commit is contained in:
@@ -295,6 +295,7 @@ class CoroutineBodyTransformer(private val context: CoroutineTransformationConte
|
||||
// Handle finally node
|
||||
if (finallyNode != null) {
|
||||
currentBlock = finallyBlock
|
||||
currentStatements += exceptionState(oldCatchBlock, x)
|
||||
finallyNode.statements.forEach { it.accept(this) }
|
||||
generateFinallyExit()
|
||||
hasFinallyBlocks = true
|
||||
|
||||
+10
@@ -6373,6 +6373,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("rethrowInFinallyWithSuspension.kt")
|
||||
public void testRethrowInFinallyWithSuspension_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/rethrowInFinallyWithSuspension.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("rethrowInFinally.kt")
|
||||
public void testRethrowInFinally_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/rethrowInFinally.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines");
|
||||
|
||||
+20
@@ -7223,6 +7223,26 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/inlineSuspendFunction.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("rethrowInFinallyWithSuspension.kt")
|
||||
public void testRethrowInFinallyWithSuspension_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/rethrowInFinallyWithSuspension.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("rethrowInFinallyWithSuspension.kt")
|
||||
public void testRethrowInFinallyWithSuspension_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/rethrowInFinallyWithSuspension.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("rethrowInFinally.kt")
|
||||
public void testRethrowInFinally_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/rethrowInFinally.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("rethrowInFinally.kt")
|
||||
public void testRethrowInFinally_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/rethrowInFinally.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/stackUnwinding/simple.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
Reference in New Issue
Block a user