Skip to content

Commit 7421cc8

Browse files
lmamminoMylesBorins
authored andcommitted
util: use let instead of var for util/inspect.js
PR-URL: #30399 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@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>
1 parent 956207f commit 7421cc8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎lib/internal/util/inspect.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ function formatPrimitive(fn, value, ctx) {
11331133

11341134
functionformatNamespaceObject(ctx,value,recurseTimes,keys){
11351135
constoutput=newArray(keys.length);
1136-
for(vari=0;i<keys.length;i++){
1136+
for(leti=0;i<keys.length;i++){
11371137
try{
11381138
output[i]=formatProperty(ctx,value,recurseTimes,keys[i],
11391139
kObjectType);
@@ -1221,7 +1221,7 @@ function formatArray(ctx, value, recurseTimes) {
12211221

12221222
constremaining=valLen-len;
12231223
constoutput=[];
1224-
for(vari=0;i<len;i++){
1224+
for(leti=0;i<len;i++){
12251225
// Special handle sparse arrays.
12261226
if(!hasOwnProperty(value,i)){
12271227
returnformatSpecialArray(ctx,value,recurseTimes,len,output,i);
@@ -1297,7 +1297,7 @@ function formatSetIterInner(ctx, recurseTimes, entries, state) {
12971297
constmaxLength=Math.min(maxArrayLength,entries.length);
12981298
letoutput=newArray(maxLength);
12991299
ctx.indentationLvl+=2;
1300-
for(vari=0;i<maxLength;i++){
1300+
for(leti=0;i<maxLength;i++){
13011301
output[i]=formatValue(ctx,entries[i],recurseTimes);
13021302
}
13031303
ctx.indentationLvl-=2;
@@ -1465,7 +1465,7 @@ function isBelowBreakLength(ctx, output, start, base) {
14651465
lettotalLength=output.length+start;
14661466
if(totalLength+output.length>ctx.breakLength)
14671467
returnfalse;
1468-
for(vari=0;i<output.length;i++){
1468+
for(leti=0;i<output.length;i++){
14691469
if(ctx.colors){
14701470
totalLength+=removeColors(output[i]).length;
14711471
}else{
@@ -1579,7 +1579,7 @@ function formatWithOptions(inspectOptions, ...args) {
15791579
lettempStr;
15801580
letlastPos=0;
15811581

1582-
for(vari=0;i<first.length-1;i++){
1582+
for(leti=0;i<first.length-1;i++){
15831583
if(first.charCodeAt(i)===37){// '%'
15841584
constnextChar=first.charCodeAt(++i);
15851585
if(a+1!==args.length){

0 commit comments

Comments
 (0)