From 8f854782b13658f169920a1a7a21b8e6b64a0c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 10 Aug 2023 06:01:35 +0200 Subject: fix(ext/timers): some timers are not resolved (#20055) Fixes https://github.com/denoland/deno/issues/19866 --- ext/web/02_timers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext/web/02_timers.js') diff --git a/ext/web/02_timers.js b/ext/web/02_timers.js index cfabdeb98..ade1c7123 100644 --- a/ext/web/02_timers.js +++ b/ext/web/02_timers.js @@ -243,6 +243,7 @@ function runAfterTimeout(task, millis, timerInfo) { resolved: false, prev: scheduledTimers.tail, next: null, + task, }; // Add timerObject to the end of the list. @@ -286,7 +287,7 @@ function runAfterTimeout(task, millis, timerInfo) { while (currentEntry !== null) { if (currentEntry.millis <= timerObject.millis) { currentEntry.resolved = true; - ArrayPrototypePush(timerTasks, task); + ArrayPrototypePush(timerTasks, currentEntry.task); removeFromScheduledTimers(currentEntry); if (currentEntry === timerObject) { -- cgit v1.2.3