@@ -15,7 +15,7 @@ const delimiter = '-'; // '\x2D'
15
15
16
16
/** Regular expressions */
17
17
const regexPunycode = / ^ x n - - / ;
18
- const regexNonASCII = / [ ^ \x20 - \x7E ] / ; // unprintable ASCII chars + non-ASCII chars
18
+ const regexNonASCII = / [ ^ \0 - \x7E ] / ; // non-ASCII chars
19
19
const regexSeparators = / [ \x2E \u3002 \uFF0E \uFF61 ] / g; // RFC 3490 separators
20
20
21
21
/** Error messages */
@@ -210,7 +210,7 @@ const decode = function(input) {
210
210
basic = 0 ;
211
211
}
212
212
213
- for ( var j = 0 ; j < basic ; ++ j ) {
213
+ for ( let j = 0 ; j < basic ; ++ j ) {
214
214
// if it's not a basic code point
215
215
if ( input . charCodeAt ( j ) >= 0x80 ) {
216
216
error ( 'not-basic' ) ;
@@ -221,15 +221,15 @@ const decode = function(input) {
221
221
// Main decoding loop: start just after the last delimiter if any basic code
222
222
// points were copied; start at the beginning otherwise.
223
223
224
- for ( var index = basic > 0 ? basic + 1 : 0 ; index < inputLength ; /* no final expression */ ) {
224
+ for ( let index = basic > 0 ? basic + 1 : 0 ; index < inputLength ; /* no final expression */ ) {
225
225
226
226
// `index` is the index of the next character to be consumed.
227
227
// Decode a generalized variable-length integer into `delta`,
228
228
// which gets added to `i`. The overflow checking is easier
229
229
// if we increase `i` as we go, then subtract off its starting
230
230
// value at the end to obtain `delta`.
231
231
let oldi = i ;
232
- for ( var w = 1 , k = base ; /* no condition */ ; k += base ) {
232
+ for ( let w = 1 , k = base ; /* no condition */ ; k += base ) {
233
233
234
234
if ( index >= inputLength ) {
235
235
error ( 'invalid-input' ) ;
@@ -345,7 +345,7 @@ const encode = function(input) {
345
345
if ( currentValue == n ) {
346
346
// Represent delta as a generalized variable-length integer.
347
347
let q = delta ;
348
- for ( var k = base ; /* no condition */ ; k += base ) {
348
+ for ( let k = base ; /* no condition */ ; k += base ) {
349
349
const t = k <= bias ? tMin : ( k >= bias + tMax ? tMax : k - bias ) ;
350
350
if ( q < t ) {
351
351
break ;
@@ -419,7 +419,7 @@ const punycode = {
419
419
* @memberOf punycode
420
420
* @type String
421
421
*/
422
- 'version' : '2.0 .0' ,
422
+ 'version' : '2.1 .0' ,
423
423
/**
424
424
* An object of methods to convert from JavaScript's internal character
425
425
* representation (UCS-2) to Unicode code points, and back.
0 commit comments