summaryrefslogtreecommitdiff
path: root/lib/punycode.js
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2013-01-11 09:57:24 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-01-16 16:53:11 +0100
commitbc764f3dffe6906abd4df5e7189b7d96f225b4f0 (patch)
tree5db723932855f83d44f04b27d07c17145825468c /lib/punycode.js
parent9668df8b3949f2a4643525fdab1e69853bcba9a5 (diff)
downloadandroid-node-v8-bc764f3dffe6906abd4df5e7189b7d96f225b4f0.tar.gz
android-node-v8-bc764f3dffe6906abd4df5e7189b7d96f225b4f0.tar.bz2
android-node-v8-bc764f3dffe6906abd4df5e7189b7d96f225b4f0.zip
punycode: update to v1.2.0
This update adds support for RFC 3490 separators for improved compatibility with web browsers.
Diffstat (limited to 'lib/punycode.js')
-rw-r--r--lib/punycode.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/punycode.js b/lib/punycode.js
index 5ca1254f6a..163923c40f 100644
--- a/lib/punycode.js
+++ b/lib/punycode.js
@@ -1,4 +1,4 @@
-/*! http://mths.be/punycode by @mathias */
+/*! http://mths.be/punycode v1.2.0 by @mathias */
;(function(root) {
/**
@@ -29,12 +29,13 @@
delimiter = '-', // '\x2D'
/** Regular expressions */
- regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
regexPunycode = /^xn--/,
+ regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
+ regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators
/** Error messages */
errors = {
- 'overflow': 'Overflow: input needs wider integers to process.',
+ 'overflow': 'Overflow: input needs wider integers to process',
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
'invalid-input': 'Invalid input'
},
@@ -85,8 +86,7 @@
* function.
*/
function mapDomain(string, fn) {
- var glue = '.';
- return map(string.split(glue), fn).join(glue);
+ return map(string.split(regexSeparators), fn).join('.');
}
/**
@@ -198,7 +198,7 @@
}
/**
- * Converts a basic code point to lowercase is `flag` is falsy, or to
+ * Converts a basic code point to lowercase if `flag` is falsy, or to
* uppercase if `flag` is truthy. The code point is unchanged if it's
* caseless. The behavior is undefined if `codePoint` is not a basic code
* point.
@@ -470,7 +470,7 @@
* @memberOf punycode
* @type String
*/
- 'version': '1.1.1',
+ 'version': '1.2.0',
/**
* An object of methods to convert from JavaScript's internal character
* representation (UCS-2) to decimal Unicode code points, and back.