This commit is contained in:
Alistair Smith
2025-06-05 15:26:56 -07:00
parent 80a23c7142
commit 5719568ec0

View File

@@ -282,7 +282,7 @@ fn setCwd_(globalObject: *jsc.JSGlobalObject, to: *jsc.ZigString) bun.JSError!js
// TODO(@190n) this may need to be noreturn
pub fn exit(globalObject: *jsc.JSGlobalObject, code: u8) callconv(.c) void {
var vm = globalObject.bunVM();
vm.exit_handler.exit_code = code; // TODO(@alii) Is setting this multiple times incorrect? There's a regression node test for this (https://linear.app/oven/issue/BUN-13917/nodejs-test-test-worker-process-exit-async-modulejs)
vm.exit_handler.exit_code = code; // TODO(@alii): https://github.com/oven-sh/bun/pull/20213
if (vm.worker) |worker| {
// TODO(@190n) we may need to use requestTerminate or throwTerminationException
// instead to terminate the worker sooner