Skip to content

Commit a2df87c

Browse files
artmakstargos
authored andcommitted
lib: change var to let/const in internal/querystring.js
PR-URL: #30286 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 47ee0be commit a2df87c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/internal/querystring.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const { ERR_INVALID_URI } = require('internal/errors').codes;
44

55
const hexTable = new Array(256);
6-
for (var i = 0; i < 256; ++i)
6+
for (let i = 0; i < 256; ++i)
77
hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
88

99
const isHexTable = [
@@ -30,11 +30,11 @@ function encodeStr(str, noEscapeTable, hexTable) {
3030
if (len === 0)
3131
return '';
3232

33-
var out = '';
34-
var lastPos = 0;
33+
let out = '';
34+
let lastPos = 0;
3535

36-
for (var i = 0; i < len; i++) {
37-
var c = str.charCodeAt(i);
36+
for (let i = 0; i < len; i++) {
37+
let c = str.charCodeAt(i);
3838

3939
// ASCII
4040
if (c < 0x80) {
@@ -73,7 +73,7 @@ function encodeStr(str, noEscapeTable, hexTable) {
7373
if (i >= len)
7474
throw new ERR_INVALID_URI();
7575

76-
var c2 = str.charCodeAt(i) & 0x3FF;
76+
const c2 = str.charCodeAt(i) & 0x3FF;
7777

7878
lastPos = i + 1;
7979
c = 0x10000 + (((c & 0x3FF) << 10) | c2);

0 commit comments

Comments
 (0)