Skip to content
Permalink
Browse files

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>
  • Loading branch information
nikolaykrashnikov authored and MylesBorins committed Nov 6, 2019
1 parent f0b6a23 commit 3d7882e0d11c0041a1e8bb0e28c9fe73a047a705
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/internal/timers.js
@@ -313,7 +313,7 @@ function insert(item, refed, start) {
item._idleStart = start;

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

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

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

var diff, timer;
let ranAtLeastOneTimer = false;
let timer;
while (timer = L.peek(list)) {
diff = now - timer._idleStart;
const diff = now - timer._idleStart;

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

0 comments on commit 3d7882e

Please sign in to comment.
You can’t perform that action at this time.