Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: replace var with let/const #30390

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/internal/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const {
encodeUtf8String
} = internalBinding('buffer');

var Buffer;
let Buffer;
function lazyBuffer() {
if (Buffer === undefined)
Buffer = require('buffer').Buffer;
Expand Down Expand Up @@ -281,8 +281,8 @@ const encodings = new Map([
// Unfortunately, String.prototype.trim also removes non-ascii whitespace,
// so we have to do this manually
function trimAsciiWhitespace(label) {
var s = 0;
var e = label.length;
let s = 0;
let e = label.length;
while (s < e && (
label[s] === '\u0009' ||
label[s] === '\u000a' ||
Expand Down Expand Up @@ -378,7 +378,7 @@ function makeTextDecoderICU() {
if (enc === undefined)
throw new ERR_ENCODING_NOT_SUPPORTED(encoding);

var flags = 0;
let flags = 0;
if (options !== null) {
flags |= options.fatal ? CONVERTER_FLAGS_FATAL : 0;
flags |= options.ignoreBOM ? CONVERTER_FLAGS_IGNORE_BOM : 0;
Expand Down Expand Up @@ -406,7 +406,7 @@ function makeTextDecoderICU() {
}
validateArgument(options, 'object', 'options', 'Object');

var flags = 0;
let flags = 0;
if (options !== null)
flags |= options.stream ? 0 : CONVERTER_FLAGS_FLUSH;

Expand All @@ -422,7 +422,7 @@ function makeTextDecoderICU() {
}

function makeTextDecoderJS() {
var StringDecoder;
let StringDecoder;
function lazyStringDecoder() {
if (StringDecoder === undefined)
({ StringDecoder } = require('string_decoder'));
Expand All @@ -444,7 +444,7 @@ function makeTextDecoderJS() {
if (enc === undefined || !hasConverter(enc))
throw new ERR_ENCODING_NOT_SUPPORTED(encoding);

var flags = 0;
let flags = 0;
if (options !== null) {
if (options.fatal) {
throw new ERR_NO_ICU('"fatal" option');
Expand Down