mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-14 07:57:57 -05:00
29 lines
730 B
TypeScript
29 lines
730 B
TypeScript
//! test_output(["boom"])
|
|
//
|
|
// Note: the original intention was for this to output ["here","nested boom","boom"] to check where
|
|
// the control flow goes. This worked at the time, but now that snapshotting variables that can be
|
|
// mutated via method calls is implemented, the code now correctly reverts those logs and the output
|
|
// is just ["boom"].
|
|
//
|
|
// TODO: Include console.log or Debug.log in tests to enable this checking.
|
|
|
|
export default function () {
|
|
let logs: unknown[] = [];
|
|
|
|
try {
|
|
logs.push("here");
|
|
|
|
try {
|
|
throw new Error("nested boom");
|
|
} catch (error) {
|
|
logs.push(error.message);
|
|
}
|
|
|
|
throw new Error("boom");
|
|
} catch (error) {
|
|
logs.push(error.message);
|
|
}
|
|
|
|
return logs;
|
|
}
|