Skip to content

Commit d648c93

Browse files
nikolaykrashnikovBridgeAR
authored andcommitted
src: lib/internal/timers.js var -> let/const
PR-URL: #30314 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 89bc252 commit d648c93

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/internal/timers.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function insert(item, refed, start) {
313313
item._idleStart = start;
314314

315315
// Use an existing list if there is one, otherwise we need to make a new one.
316-
var list = timerListMap[msecs];
316+
let list = timerListMap[msecs];
317317
if (list === undefined) {
318318
debug('no %d list was found in insert, creating a new one', msecs);
319319
const expiry = start + msecs;
@@ -396,7 +396,7 @@ function getTimerCallbacks(runNextTicks) {
396396
function processImmediate() {
397397
const queue = outstandingQueue.head !== null ?
398398
outstandingQueue : immediateQueue;
399-
var immediate = queue.head;
399+
let immediate = queue.head;
400400

401401
// Clear the linked list early in case new `setImmediate()`
402402
// calls occur while immediate callbacks are executed
@@ -482,10 +482,10 @@ function getTimerCallbacks(runNextTicks) {
482482

483483
debug('timeout callback %d', msecs);
484484

485-
var diff, timer;
486485
let ranAtLeastOneTimer = false;
486+
let timer;
487487
while (timer = L.peek(list)) {
488-
diff = now - timer._idleStart;
488+
const diff = now - timer._idleStart;
489489

490490
// Check if this loop iteration is too early for the next timer.
491491
// This happens if there are more timers scheduled for later in the list.

0 commit comments

Comments
 (0)