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: lib/internal/querystring.js var -> let/const #30286

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
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