diff options
author | Artem Maksimov <temamaksimov@gmail.com> | 2019-11-06 13:57:02 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-11-19 08:33:55 +0300 |
commit | c1f0e80989cc653e5177827cf1f40785d32dc204 (patch) | |
tree | 332ee4f26b58696d1a44f1ed0bd6c959fc1e4650 /lib/internal/querystring.js | |
parent | 8fbbab847707180a34ab50ead0d945520049fd2d (diff) |
lib: change var to let/const in internal/querystring.js
PR-URL: https://github.com/nodejs/node/pull/30286
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/querystring.js')
-rw-r--r-- | lib/internal/querystring.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/internal/querystring.js b/lib/internal/querystring.js index ca978eb69d7..ecb4e072d83 100644 --- a/lib/internal/querystring.js +++ b/lib/internal/querystring.js @@ -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 = [ @@ -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) { @@ -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); |