Files
tsgo/testdata/tests/cases/compiler/unreachableFlowAfterThrowingForHead2.ts

31 lines
410 B
TypeScript

// @strict: true
// @noEmit: true
// @allowUnreachableCode: true, false
function test1(v: 0 | 1 | 2) {
for (
(function () {
throw new Error("");
})();
v;
v++
) {
console.log("1");
}
}
function test2(v: 0 | 1 | 2) {
try {
for (
(function () {
throw new Error("");
})();
v;
v++
) {
console.log("1");
}
} catch (e) {}
v;
}