Skip to content

Commit

Permalink
lib: change var to let/const in internal/querystring.js
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
artmaks authored and targos committed Dec 1, 2019
1 parent 47ee0be commit a2df87c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/internal/querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const { ERR_INVALID_URI } = require('internal/errors').codes;

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

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

var out = '';
var lastPos = 0;
let out = '';
let lastPos = 0;

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

// ASCII
if (c < 0x80) {
Expand Down Expand Up @@ -73,7 +73,7 @@ function encodeStr(str, noEscapeTable, hexTable) {
if (i >= len)
throw new ERR_INVALID_URI();

var c2 = str.charCodeAt(i) & 0x3FF;
const c2 = str.charCodeAt(i) & 0x3FF;

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

0 comments on commit a2df87c

Please sign in to comment.