Skip to content

Commit a353179

Browse files
Tijl5targos
authored andcommittedDec 1, 2019
lib: replace var with let/const
PR-URL: #30390 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 49f3558 commit a353179

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎lib/internal/encoding.js

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

39-
var Buffer;
39+
let Buffer;
4040
function lazyBuffer() {
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
function trimAsciiWhitespace(label) {
284-
var s = 0;
285-
var e = label.length;
284+
let s = 0;
285+
let e = 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
throw new ERR_ENCODING_NOT_SUPPORTED(encoding);
380380

381-
var flags = 0;
381+
let flags = 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-
var flags = 0;
409+
let flags = 0;
410410
if (options !== null)
411411
flags |= options.stream ? 0 : CONVERTER_FLAGS_FLUSH;
412412

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

424424
function makeTextDecoderJS() {
425-
var StringDecoder;
425+
let StringDecoder;
426426
function lazyStringDecoder() {
427427
if (StringDecoder === undefined)
428428
({ StringDecoder } = require('string_decoder'));
@@ -444,7 +444,7 @@ function makeTextDecoderJS() {
444444
if (enc === undefined || !hasConverter(enc))
445445
throw new ERR_ENCODING_NOT_SUPPORTED(encoding);
446446

447-
var flags = 0;
447+
let flags = 0;
448448
if (options !== null) {
449449
if (options.fatal) {
450450
throw new ERR_NO_ICU('"fatal" option');

0 commit comments

Comments
 (0)