Skip to content

Commit

Permalink
timers: fix unsafe array iteration
Browse files Browse the repository at this point in the history
Fixes: #37222

PR-URL: #37223
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
RaisinTen authored and targos committed Jun 11, 2021
1 parent d9eb8b3 commit 1dc7fd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/timers.js
Expand Up @@ -79,6 +79,7 @@ const {
NumberMIN_SAFE_INTEGER,
ObjectCreate,
Symbol,
ReflectApply,
} = primordials;

const {
Expand Down Expand Up @@ -555,7 +556,7 @@ function getTimerCallbacks(runNextTicks) {
if (args === undefined)
timer._onTimeout();
else
timer._onTimeout(...args);
ReflectApply(timer._onTimeout, timer, args);
} finally {
if (timer._repeat && timer._idleTimeout !== -1) {
timer._idleTimeout = timer._repeat;
Expand Down

0 comments on commit 1dc7fd2

Please sign in to comment.