diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index c0aed04f32f2fb175c20995388fdc6cd066c60b9..f18efd391649c9f1b48035db109be87308a3f481 100644 --- a/ts2panda/src/compiler.ts +++ b/ts2panda/src/compiler.ts @@ -627,6 +627,7 @@ export class Compiler { compileFinallyBeforeCFC(endTry: TryStatement | undefined, cfc: ControlFlowChange, continueTargetLabel: Label | undefined) {// compile finally before control flow change let startTry = TryStatement.getCurrentTryStatement(); let originTry = startTry; + let currentScope = this.scope; for (; startTry != endTry; startTry = startTry?.getOuterTryStatement()) { if (startTry && startTry.trybuilder) { @@ -646,6 +647,7 @@ export class Compiler { updateCatchTables(originTry, startTry, inlinedLabelPair); } } + this.scope = currentScope; } constructTry(node: ts.Node, tryBuilder: TryBuilderBase, endLabel?: Label) {