Files
ValueScript/inputs/passing/exceptions/revertMethodCallOnCatch.ts
2023-03-30 11:45:40 +11:00

23 lines
282 B
TypeScript

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