mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Co-authored-by: Georgijs Vilums <=> Co-authored-by: gvilums <gvilums@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
30 lines
537 B
JavaScript
30 lines
537 B
JavaScript
let monitorCalled = false;
|
|
|
|
setTimeout(() => {
|
|
// uncaughtExceptionMonitor should be called
|
|
if (!monitorCalled) {
|
|
process.exit(1);
|
|
}
|
|
// timeouts should be processed
|
|
process.exit(42);
|
|
}, 1);
|
|
|
|
process.on("uncaughtExceptionMonitor", err => {
|
|
monitorCalled = true;
|
|
if (!err) {
|
|
process.exit(1);
|
|
}
|
|
});
|
|
|
|
process.on("uncaughtException", err => {
|
|
// there should be an error
|
|
if (!err) {
|
|
process.exit(1);
|
|
}
|
|
});
|
|
|
|
throw new Error("error");
|
|
|
|
// this shouldn't be hit even if the exception is caught
|
|
process.exit(1);
|