summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-07-11 10:57:46 -0700
committerRich Trott <rtrott@gmail.com>2018-07-16 15:55:15 -0700
commitab10bfe376b17f3f3567605148ef6fdcc5caef7c (patch)
tree9a3e186fc060b1c028f0231b367214887f95389f
parent210fea51f40e62da07b18bef57e0dbb0184c5b4b (diff)
downloadandroid-node-v8-ab10bfe376b17f3f3567605148ef6fdcc5caef7c.tar.gz
android-node-v8-ab10bfe376b17f3f3567605148ef6fdcc5caef7c.tar.bz2
android-node-v8-ab10bfe376b17f3f3567605148ef6fdcc5caef7c.zip
lib: update punycode to 2.1.1
PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r--lib/punycode.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/punycode.js b/lib/punycode.js
index 34da3ca5ad..ea61fd0d39 100644
--- a/lib/punycode.js
+++ b/lib/punycode.js
@@ -15,7 +15,7 @@ const delimiter = '-'; // '\x2D'
/** Regular expressions */
const regexPunycode = /^xn--/;
-const regexNonASCII = /[^\x20-\x7E]/; // unprintable ASCII chars + non-ASCII chars
+const regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
/** Error messages */
@@ -210,7 +210,7 @@ const decode = function(input) {
basic = 0;
}
- for (var j = 0; j < basic; ++j) {
+ for (let j = 0; j < basic; ++j) {
// if it's not a basic code point
if (input.charCodeAt(j) >= 0x80) {
error('not-basic');
@@ -221,7 +221,7 @@ const decode = function(input) {
// Main decoding loop: start just after the last delimiter if any basic code
// points were copied; start at the beginning otherwise.
- for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
+ for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
// `index` is the index of the next character to be consumed.
// Decode a generalized variable-length integer into `delta`,
@@ -229,7 +229,7 @@ const decode = function(input) {
// if we increase `i` as we go, then subtract off its starting
// value at the end to obtain `delta`.
let oldi = i;
- for (var w = 1, k = base; /* no condition */; k += base) {
+ for (let w = 1, k = base; /* no condition */; k += base) {
if (index >= inputLength) {
error('invalid-input');
@@ -345,7 +345,7 @@ const encode = function(input) {
if (currentValue == n) {
// Represent delta as a generalized variable-length integer.
let q = delta;
- for (var k = base; /* no condition */; k += base) {
+ for (let k = base; /* no condition */; k += base) {
const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (q < t) {
break;
@@ -419,7 +419,7 @@ const punycode = {
* @memberOf punycode
* @type String
*/
- 'version': '2.0.0',
+ 'version': '2.1.0',
/**
* An object of methods to convert from JavaScript's internal character
* representation (UCS-2) to Unicode code points, and back.