Skip to content

Commit a353179

Browse files
Tijl5targos
authored andcommitted
lib: replace var with let/const
PR-URL: #30390 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> 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 49f3558 commit a353179

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎lib/internal/encoding.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const {
3636
encodeUtf8String
3737
}=internalBinding('buffer');
3838

39-
varBuffer;
39+
letBuffer;
4040
functionlazyBuffer(){
4141
if(Buffer===undefined)
4242
Buffer=require('buffer').Buffer;
@@ -281,8 +281,8 @@ const encodings = new Map([
281281
// Unfortunately, String.prototype.trim also removes non-ascii whitespace,
282282
// so we have to do this manually
283283
functiontrimAsciiWhitespace(label){
284-
vars=0;
285-
vare=label.length;
284+
lets=0;
285+
lete=label.length;
286286
while(s<e&&(
287287
label[s]==='\u0009'||
288288
label[s]==='\u000a'||
@@ -378,7 +378,7 @@ function makeTextDecoderICU() {
378378
if(enc===undefined)
379379
thrownewERR_ENCODING_NOT_SUPPORTED(encoding);
380380

381-
varflags=0;
381+
letflags=0;
382382
if(options!==null){
383383
flags|=options.fatal ? CONVERTER_FLAGS_FATAL : 0;
384384
flags|=options.ignoreBOM ? CONVERTER_FLAGS_IGNORE_BOM : 0;
@@ -406,7 +406,7 @@ function makeTextDecoderICU() {
406406
}
407407
validateArgument(options,'object','options','Object');
408408

409-
varflags=0;
409+
letflags=0;
410410
if(options!==null)
411411
flags|=options.stream ? 0 : CONVERTER_FLAGS_FLUSH;
412412

@@ -422,7 +422,7 @@ function makeTextDecoderICU() {
422422
}
423423

424424
functionmakeTextDecoderJS(){
425-
varStringDecoder;
425+
letStringDecoder;
426426
functionlazyStringDecoder(){
427427
if(StringDecoder===undefined)
428428
({ StringDecoder }=require('string_decoder'));
@@ -444,7 +444,7 @@ function makeTextDecoderJS() {
444444
if(enc===undefined||!hasConverter(enc))
445445
thrownewERR_ENCODING_NOT_SUPPORTED(encoding);
446446

447-
varflags=0;
447+
letflags=0;
448448
if(options!==null){
449449
if(options.fatal){
450450
thrownewERR_NO_ICU('"fatal" option');

0 commit comments

Comments
 (0)