Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/punycode.js

Issue 29340571: Issue 3687 - Add experimental support for Safari content blockers (Closed)
Patch Set: Don't avoid type conversion Created May 18, 2016, 9:24 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/prefs.js ('k') | lib/tldjs.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*! http://mths.be/punycode v1.2.3 by @mathias */ 1 /*! http://mths.be/punycode v1.2.3 by @mathias */
2 /* Used under GPL 2.0, see https://github.com/bestiejs/punycode.js/blob/master/L ICENSE-GPL.txt */ 2 /* Used under GPL 2.0, see https://github.com/bestiejs/punycode.js/blob/master/L ICENSE-GPL.txt */
3 ;(function(root) { 3 ;(function() {
4
5 » /** Detect free variables */
6 » var freeExports = typeof exports == 'object' && exports;
7 » var freeModule = typeof module == 'object' && module &&
8 » » module.exports == freeExports && module;
9 » var freeGlobal = typeof global == 'object' && global;
10 » if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal ) {
11 » » root = freeGlobal;
12 » }
13
14 /** 4 /**
15 * The `punycode` object. 5 * The `punycode` object.
16 * @name punycode 6 * @name punycode
17 * @type Object 7 * @type Object
18 */ 8 */
19 var punycode, 9 var punycode,
20 10
21 /** Highest positive signed 32-bit float value */ 11 /** Highest positive signed 32-bit float value */
22 maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 12 maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
23 13
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 return mapDomain(domain, function(string) { 442 return mapDomain(domain, function(string) {
453 return regexNonASCII.test(string) 443 return regexNonASCII.test(string)
454 ? 'xn--' + encode(string) 444 ? 'xn--' + encode(string)
455 : string; 445 : string;
456 }); 446 });
457 } 447 }
458 448
459 /*---------------------------------------------------------------------- ----*/ 449 /*---------------------------------------------------------------------- ----*/
460 450
461 /** Define the public API */ 451 /** Define the public API */
462 » punycode = { 452 » exports = {
463 /** 453 /**
464 * A string representing the current Punycode.js version number. 454 * A string representing the current Punycode.js version number.
465 * @memberOf punycode 455 * @memberOf punycode
466 * @type String 456 * @type String
467 */ 457 */
468 'version': '1.2.3', 458 'version': '1.2.3',
469 /** 459 /**
470 * An object of methods to convert from JavaScript's internal ch aracter 460 * An object of methods to convert from JavaScript's internal ch aracter
471 * representation (UCS-2) to Unicode code points, and back. 461 * representation (UCS-2) to Unicode code points, and back.
472 * @see <http://mathiasbynens.be/notes/javascript-encoding> 462 * @see <http://mathiasbynens.be/notes/javascript-encoding>
473 * @memberOf punycode 463 * @memberOf punycode
474 * @type Object 464 * @type Object
475 */ 465 */
476 'ucs2': { 466 'ucs2': {
477 'decode': ucs2decode, 467 'decode': ucs2decode,
478 'encode': ucs2encode 468 'encode': ucs2encode
479 }, 469 },
480 'decode': decode, 470 'decode': decode,
481 'encode': encode, 471 'encode': encode,
482 'toASCII': toASCII, 472 'toASCII': toASCII,
483 'toUnicode': toUnicode 473 'toUnicode': toUnicode
484 }; 474 };
485 475 }());
486 » /** Expose `punycode` */
487 » // Some AMD build optimizers, like r.js, check for specific condition pa tterns
488 » // like the following:
489 » if (
490 » » typeof define == 'function' &&
491 » » typeof define.amd == 'object' &&
492 » » define.amd
493 » ) {
494 » » define(function() {
495 » » » return punycode;
496 » » });
497 » }» else if (freeExports && !freeExports.nodeType) {
498 » » if (freeModule) { // in Node.js or RingoJS v0.8.0+
499 » » » freeModule.exports = punycode;
500 » » } else { // in Narwhal or RingoJS v0.7.0-
501 » » » for (key in punycode) {
502 » » » » punycode.hasOwnProperty(key) && (freeExports[key ] = punycode[key]);
503 » » » }
504 » » }
505 » } else { // in Rhino or a web browser
506 » » root.punycode = punycode;
507 » }
508
509 }(this));
OLDNEW
« no previous file with comments | « lib/prefs.js ('k') | lib/tldjs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld