Files
ValueScript/inputs/passing/exceptions/revertOnCatch.ts
2023-03-24 18:36:22 +11:00

23 lines
262 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;
}