From ec7f3ce1c27d7c2d231a75d6a4eea82867d7ad2b Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Tue, 10 Dec 2019 03:21:30 -0800 Subject: [PATCH] timer: due/now Math.max instead of min (#3477) --- cli/js/timers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/js/timers.ts b/cli/js/timers.ts index 24c9ebf9ae..a13345c40b 100644 --- a/cli/js/timers.ts +++ b/cli/js/timers.ts @@ -192,7 +192,7 @@ function firePendingTimers(): void { pendingScheduleTimers = []; // Reschedule for next round of timeout. const nextDueNode = dueTree.min(); - const due = nextDueNode && Math.min(nextDueNode.due, now); + const due = nextDueNode && Math.max(nextDueNode.due, now); setOrClearGlobalTimeout(due, now); } else { // Fire a single timer and allow its children microtasks scheduled first.