Skip to content

Commit 4ed4bf3

Browse files
Trotttargos
authored andcommitted
lib: update punycode to 2.1.1
PR-URL: #21768 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 67908e9 commit 4ed4bf3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎lib/punycode.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const delimiter = '-'; // '\x2D'
1515

1616
/** Regular expressions */
1717
constregexPunycode=/^xn--/;
18-
constregexNonASCII=/[^\x20-\x7E]/;// unprintable ASCII chars + non-ASCII chars
18+
constregexNonASCII=/[^\0-\x7E]/;// non-ASCII chars
1919
constregexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g;// RFC 3490 separators
2020

2121
/** Error messages */
@@ -210,7 +210,7 @@ const decode = function(input) {
210210
basic=0;
211211
}
212212

213-
for(varj=0;j<basic;++j){
213+
for(letj=0;j<basic;++j){
214214
// if it's not a basic code point
215215
if(input.charCodeAt(j)>=0x80){
216216
error('not-basic');
@@ -221,15 +221,15 @@ const decode = function(input) {
221221
// Main decoding loop: start just after the last delimiter if any basic code
222222
// points were copied; start at the beginning otherwise.
223223

224-
for(varindex=basic>0 ? basic+1 : 0;index<inputLength;/* no final expression */){
224+
for(letindex=basic>0 ? basic+1 : 0;index<inputLength;/* no final expression */){
225225

226226
// `index` is the index of the next character to be consumed.
227227
// Decode a generalized variable-length integer into `delta`,
228228
// which gets added to `i`. The overflow checking is easier
229229
// if we increase `i` as we go, then subtract off its starting
230230
// value at the end to obtain `delta`.
231231
letoldi=i;
232-
for(varw=1,k=base;/* no condition */;k+=base){
232+
for(letw=1,k=base;/* no condition */;k+=base){
233233

234234
if(index>=inputLength){
235235
error('invalid-input');
@@ -345,7 +345,7 @@ const encode = function(input) {
345345
if(currentValue==n){
346346
// Represent delta as a generalized variable-length integer.
347347
letq=delta;
348-
for(vark=base;/* no condition */;k+=base){
348+
for(letk=base;/* no condition */;k+=base){
349349
constt=k<=bias ? tMin : (k>=bias+tMax ? tMax : k-bias);
350350
if(q<t){
351351
break;
@@ -419,7 +419,7 @@ const punycode = {
419419
* @memberOf punycode
420420
* @type String
421421
*/
422-
'version': '2.0.0',
422+
'version': '2.1.0',
423423
/**
424424
* An object of methods to convert from JavaScript's internal character
425425
* representation (UCS-2) to Unicode code points, and back.

0 commit comments

Comments
 (0)