Skip to content

Commit

Permalink
lib: (timers) make arguments array PACKED in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Sep 4, 2024
1 parent 65a4d26 commit a80fabd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'use strict';

const {
ArrayPrototypePush,
MathTrunc,
ObjectDefineProperties,
ObjectDefineProperty,
Expand Down Expand Up @@ -154,7 +155,7 @@ function setTimeout(callback, after, arg1, arg2, arg3) {
args = [arg1, arg2, arg3];
for (i = 5; i < arguments.length; i++) {
// Extend array dynamically, makes .apply run much faster in v6.0.0
args[i - 2] = arguments[i];
ArrayPrototypePush(args, arguments[i]);
}
break;
}
Expand Down Expand Up @@ -224,7 +225,7 @@ function setInterval(callback, repeat, arg1, arg2, arg3) {
args = [arg1, arg2, arg3];
for (i = 5; i < arguments.length; i++) {
// Extend array dynamically, makes .apply run much faster in v6.0.0
args[i - 2] = arguments[i];
ArrayPrototypePush(args, arguments[i]);
}
break;
}
Expand Down

0 comments on commit a80fabd

Please sign in to comment.