See re-throw test in test/unit/error.spec.ts:
const i: number = ${i};
function foo() {
try {
try {
if (i === 0) { throw "z"; }
} catch (e) {
throw "a";
} finally {
if (i === 1) { throw "b"; }
}
} catch (e) {
throw (e as string).toUpperCase();
} finally {
throw "C";
}
}
let result: string = "x";
try {
foo();
} catch (e) {
result = (e as string)[(e as string).length - 1];
}
return result;