Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3796885

Browse filesBrowse files
Tijl5addaleax
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 30ef8e4 commit 3796885
Copy full SHA for 3796885

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎lib/internal/encoding.js‎

Copy file name to clipboardExpand all lines: lib/internal/encoding.js
+7-7Lines 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-
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.