diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-08-10 06:01:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 04:01:35 +0000 |
commit | 8f854782b13658f169920a1a7a21b8e6b64a0c00 (patch) | |
tree | 16f69266d92a8dbd78dee48f27e8efccf670baa5 /ext/web | |
parent | 2507d6fa102488ed77b41a5893b311830f6fe9c9 (diff) |
fix(ext/timers): some timers are not resolved (#20055)
Fixes https://github.com/denoland/deno/issues/19866
Diffstat (limited to 'ext/web')
-rw-r--r-- | ext/web/02_timers.js | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |