Files
ValueScript/inputs/passing/exceptions/revertOnCatch.ts
2023-05-31 12:18:32 +10:00

23 lines
263 B
TypeScript

//! test_output([0,1])
export default function () {
return [
test(true),
test(false),
];
}
function test(shouldThrow: boolean) {
let x = 0;
try {
x++;
if (shouldThrow) {
throw new Error("boom");
}
} catch {}
return x;
}