X Tutup
Skip to content

try/finally does not behave as expected when rethrowing #1137

@Perryvw

Description

@Perryvw

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup