Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: lib/internal/timers.js var -> let/const #30314

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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