From b545b91de543dc20dfbc2c7f26cc7c4b7fbc17e7 Mon Sep 17 00:00:00 2001 From: Shubham Chaturvedi <19shubham11@gmail.com> Date: Tue, 12 Nov 2019 14:47:03 +0000 Subject: [PATCH] lib: use let instead of var this commit uses let instead of var for util.js & warning.js PR-URL: https://github.com/nodejs/node/pull/30375 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Beth Griggs Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- lib/internal/process/warning.js | 2 +- lib/internal/util.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 3ad3d4b9fbaa04..67a553e21afb16 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -58,7 +58,7 @@ function onWarning(warning) { if (isDeprecation && process.noDeprecation) return; const trace = process.traceProcessWarnings || (isDeprecation && process.traceDeprecation); - var msg = `(${process.release.name}:${process.pid}) `; + let msg = `(${process.release.name}:${process.pid}) `; if (warning.code) msg += `[${warning.code}] `; if (trace && warning.stack) { diff --git a/lib/internal/util.js b/lib/internal/util.js index 58502f3b7a7a93..68ff205f80f7c2 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -166,7 +166,7 @@ function emitExperimentalWarning(feature) { function filterDuplicateStrings(items, low) { const map = new Map(); - for (var i = 0; i < items.length; i++) { + for (let i = 0; i < items.length; i++) { const item = items[i]; const key = item.toLowerCase(); if (low) { @@ -281,7 +281,7 @@ function promisify(original) { } if (argumentNames !== undefined && values.length > 1) { const obj = {}; - for (var i = 0; i < argumentNames.length; i++) + for (let i = 0; i < argumentNames.length; i++) obj[argumentNames[i]] = values[i]; resolve(obj); } else {