Skip to content

Commit dc38dd2

Browse files
RaisinTendanielleadams
authored andcommitted
timers: fix unsafe array iteration
Fixes: #37222 PR-URL: #37223 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 3fee5b2 commit dc38dd2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/timers.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const {
7979
NumberMIN_SAFE_INTEGER,
8080
ObjectCreate,
8181
Symbol,
82+
ReflectApply,
8283
} = primordials;
8384

8485
const {
@@ -555,7 +556,7 @@ function getTimerCallbacks(runNextTicks) {
555556
if (args === undefined)
556557
timer._onTimeout();
557558
else
558-
timer._onTimeout(...args);
559+
ReflectApply(timer._onTimeout, timer, args);
559560
} finally {
560561
if (timer._repeat && timer._idleTimeout !== -1) {
561562
timer._idleTimeout = timer._repeat;

0 commit comments

Comments
 (0)