summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTijl Claessens <tijl.claessens@hotmail.com>2019-11-12 16:08:20 +0100
committerGireesh Punathil <gpunathi@in.ibm.com>2019-11-26 13:30:38 +0530
commit00e22766d171f9914d2cff4608bffdd317c50e23 (patch)
tree10f980118687f9d2355574216fbd456db5ee7113 /lib
parentdba276dde9cabba1cda334e2c602e935d75a2c2c (diff)
downloadandroid-node-v8-00e22766d171f9914d2cff4608bffdd317c50e23.tar.gz
android-node-v8-00e22766d171f9914d2cff4608bffdd317c50e23.tar.bz2
android-node-v8-00e22766d171f9914d2cff4608bffdd317c50e23.zip
lib: replace var with let/const
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/encoding.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js
index d1b4cbfe9b..fe940f6e86 100644
--- a/lib/internal/encoding.js
+++ b/lib/internal/encoding.js
@@ -40,7 +40,7 @@ const {
encodeUtf8String
} = internalBinding('buffer');
-var Buffer;
+let Buffer;
function lazyBuffer() {
if (Buffer === undefined)
Buffer = require('buffer').Buffer;
@@ -285,8 +285,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' ||
@@ -382,7 +382,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;
@@ -410,7 +410,7 @@ function makeTextDecoderICU() {
}
validateArgument(options, 'object', 'options', 'Object');
- var flags = 0;
+ let flags = 0;
if (options !== null)
flags |= options.stream ? 0 : CONVERTER_FLAGS_FLUSH;
@@ -426,7 +426,7 @@ function makeTextDecoderICU() {
}
function makeTextDecoderJS() {
- var StringDecoder;
+ let StringDecoder;
function lazyStringDecoder() {
if (StringDecoder === undefined)
({ StringDecoder } = require('string_decoder'));
@@ -448,7 +448,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');