aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/event_loop.zig2
-rw-r--r--src/bun_js.zig2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index c5927298a..6331480d8 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -489,7 +489,7 @@ pub const EventLoop = struct {
var global_vm = ctx.global.vm();
while (true) {
- while (this.tickWithCount() > 0) {
+ while (this.tickWithCount() > 0) : (this.global.handleRejectedPromises()) {
this.tickConcurrent();
} else {
global_vm.releaseWeakRefs();
diff --git a/src/bun_js.zig b/src/bun_js.zig
index fce2108bd..c9b6cb490 100644
--- a/src/bun_js.zig
+++ b/src/bun_js.zig
@@ -180,6 +180,8 @@ pub const Run = struct {
}
}
+ this.vm.global.handleRejectedPromises();
+
this.vm.onExit();
if (!JSC.is_bindgen) JSC.napi.fixDeadCodeElimination();