timers: fix unsafe array iteration
Fixes: https://github.com/nodejs/node/issues/37222 PR-URL: https://github.com/nodejs/node/pull/37223 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
3aba6fef07
commit
c0e66e3e9d
@ -79,6 +79,7 @@ const {
|
||||
NumberMIN_SAFE_INTEGER,
|
||||
ObjectCreate,
|
||||
Symbol,
|
||||
ReflectApply,
|
||||
} = primordials;
|
||||
|
||||
const {
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user