GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — timers: avoid generating holey internal arrays · nodejs/node@5358601

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • timers.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/timers.js‎

Copy file name to clipboardExpand all lines: lib/timers.js
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
'use strict';
2323

2424
const {
25+
ArrayPrototypePush,
2526
MathTrunc,
2627
ObjectDefineProperty,
2728
ObjectDefineProperties,
@@ -154,7 +155,7 @@ function setTimeout(callback, after, arg1, arg2, arg3) {
154155
args = [arg1, arg2, arg3];
155156
for (i = 5; i < arguments.length; i++) {
156157
// Extend array dynamically, makes .apply run much faster in v6.0.0
157-
args[i - 2] = arguments[i];
158+
ArrayPrototypePush(args, arguments[i]);
158159
}
159160
break;
160161
}
@@ -224,7 +225,7 @@ function setInterval(callback, repeat, arg1, arg2, arg3) {
224225
args = [arg1, arg2, arg3];
225226
for (i = 5; i < arguments.length; i++) {
226227
// Extend array dynamically, makes .apply run much faster in v6.0.0
227-
args[i - 2] = arguments[i];
228+
ArrayPrototypePush(args, arguments[i]);
228229
}
229230
break;
230231
}
@@ -296,7 +297,7 @@ function setImmediate(callback, arg1, arg2, arg3) {
296297
args = [arg1, arg2, arg3];
297298
for (i = 4; i < arguments.length; i++) {
298299
// Extend array dynamically, makes .apply run much faster in v6.0.0
299-
args[i - 1] = arguments[i];
300+
ArrayPrototypePush(args, arguments[i]);
300301
}
301302
break;
302303
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.