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 May 30, 2021
1 parent 38fcb63 commit a9483c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/timers.js
Original file line number Diff line number Diff line change
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 a9483c3

Please sign in to comment.