summaryrefslogtreecommitdiff
path: root/lib/internal/timers.js
diff options
context:
space:
mode:
authorNikolay Krashnikov <1090219@mail.ru>2019-11-06 17:48:22 +0300
committerGireesh Punathil <gpunathi@in.ibm.com>2019-11-17 21:08:33 +0530
commit9bda2bb5b8cc2c87492203571179ae187c5840ce (patch)
tree7cfa6e1bce947ccc4c1a987aa43088eda725d4c3 /lib/internal/timers.js
parent6e30216f4e953dcc73c5d5893d4a4ced7f05dc80 (diff)
downloadandroid-node-v8-9bda2bb5b8cc2c87492203571179ae187c5840ce.tar.gz
android-node-v8-9bda2bb5b8cc2c87492203571179ae187c5840ce.tar.bz2
android-node-v8-9bda2bb5b8cc2c87492203571179ae187c5840ce.zip
src: lib/internal/timers.js var -> let/const
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib/internal/timers.js')
-rw-r--r--lib/internal/timers.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/internal/timers.js b/lib/internal/timers.js
index bb18881981..4067c2ee0b 100644
--- a/lib/internal/timers.js
+++ b/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.