Skip to content

Commit

Permalink
src: lib/internal/timers.js var -> let/const
Browse files Browse the repository at this point in the history
PR-URL: #30314
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
nikolaykrashnikov authored and BridgeAR committed Nov 19, 2019
1 parent 89bc252 commit d648c93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/internal/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d648c93

Please sign in to comment.