From 0789cb9790b3bc30ed67b5772ee2c5b03812a68c Mon Sep 17 00:00:00 2001 From: carlosmiei <43336371+carlosmiei@users.noreply.github.com> Date: Sun, 28 Jun 2026 11:11:17 +0100 Subject: [PATCH] fix(base): clean className reference --- src/baseTranspiler.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/baseTranspiler.ts b/src/baseTranspiler.ts index ddc2d35..058c819 100644 --- a/src/baseTranspiler.ts +++ b/src/baseTranspiler.ts @@ -1875,6 +1875,12 @@ class BaseTranspiler { } if (node.statements) { + if (ts.isSourceFile(node)) { + // reset the current class name when entering a new file so a + // class name from a previously transpiled file does not leak + // into a class-less file (e.g. try/catch wrappers in tests) + this.className = "undefined"; + } const transformedStatements = node.statements.map((m)=> { return this.printNode(m, identation + 1); });