From e2787f09617687d202ddcaea31fc34ae647025d5 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Fri, 2 Aug 2024 19:32:57 -0700 Subject: [PATCH] windows: handling uncaughtException shouldnt infer tickPossiblyForever with libuv --- src/bun_js.zig | 8 ++++++-- test/js/node/process/process.test.js | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bun_js.zig b/src/bun_js.zig index 66cc339936..0c54a59bd0 100644 --- a/src/bun_js.zig +++ b/src/bun_js.zig @@ -307,11 +307,15 @@ pub const Run = struct { if (vm.loadEntryPoint(this.entry_path)) |promise| { if (promise.status(vm.global.vm()) == .Rejected) { const handled = vm.uncaughtException(vm.global, promise.result(vm.global.vm()), true); + const hot_reload = vm.hot_reload != .none; - if (vm.hot_reload != .none or handled) { + if (handled) { vm.eventLoop().tick(); + } + if (hot_reload) { vm.eventLoop().tickPossiblyForever(); - } else { + } + if (!handled and !hot_reload) { vm.exit_handler.exit_code = 1; vm.onExit(); diff --git a/test/js/node/process/process.test.js b/test/js/node/process/process.test.js index 825b5bde45..bc6aca7af9 100644 --- a/test/js/node/process/process.test.js +++ b/test/js/node/process/process.test.js @@ -885,7 +885,7 @@ describe("process.exitCode", () => { ]).toRunInlineFixture(); }); - it.todoIf(isWindows)("zeroExitWithUncaughtHandler", () => { + it("zeroExitWithUncaughtHandler", () => { expect([ ` process.on('exit', (code) => { @@ -906,7 +906,7 @@ describe("process.exitCode", () => { ]).toRunInlineFixture(); }); - it.todoIf(isWindows)("changeCodeInUncaughtHandler", () => { + it("changeCodeInUncaughtHandler", () => { expect([ ` process.on('exit', (code) => {