mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
23 lines
282 B
TypeScript
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;
|
|
}
|