OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains support for URI manipulations written in | 5 // This file contains support for URI manipulations written in |
6 // JavaScript. | 6 // JavaScript. |
7 | 7 |
8 (function() { | 8 (function(global, shared, exports) { |
9 | 9 |
10 "use strict"; | 10 "use strict"; |
11 | 11 |
12 %CheckIsBootstrapping(); | 12 %CheckIsBootstrapping(); |
13 | 13 |
14 var GlobalObject = global.Object; | 14 var GlobalObject = global.Object; |
15 var GlobalArray = global.Array; | 15 var GlobalArray = global.Array; |
16 | 16 |
17 // ------------------------------------------------------------------- | 17 // ------------------------------------------------------------------- |
18 // Define internal helper functions. | 18 // Define internal helper functions. |
(...skipping 14 matching lines...) Expand all Loading... |
33 // a - z | 33 // a - z |
34 if (97 <= cc && cc <= 122) return true; | 34 if (97 <= cc && cc <= 122) return true; |
35 // A - Z | 35 // A - Z |
36 if (65 <= cc && cc <= 90) return true; | 36 if (65 <= cc && cc <= 90) return true; |
37 // 0 - 9 | 37 // 0 - 9 |
38 if (48 <= cc && cc <= 57) return true; | 38 if (48 <= cc && cc <= 57) return true; |
39 | 39 |
40 return false; | 40 return false; |
41 } | 41 } |
42 | 42 |
43 //Lazily initialized. | 43 // Lazily initialized. |
44 var hexCharCodeArray = 0; | 44 var hexCharCodeArray = 0; |
45 | 45 |
46 function URIAddEncodedOctetToBuffer(octet, result, index) { | 46 function URIAddEncodedOctetToBuffer(octet, result, index) { |
47 result[index++] = 37; // Char code of '%'. | 47 result[index++] = 37; // Char code of '%'. |
48 result[index++] = hexCharCodeArray[octet >> 4]; | 48 result[index++] = hexCharCodeArray[octet >> 4]; |
49 result[index++] = hexCharCodeArray[octet & 0x0F]; | 49 result[index++] = hexCharCodeArray[octet & 0x0F]; |
50 return index; | 50 return index; |
51 } | 51 } |
52 | 52 |
53 function URIEncodeOctets(octets, result, index) { | 53 function URIEncodeOctets(octets, result, index) { |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 // their names. | 358 // their names. |
359 $installFunctions(global, DONT_ENUM, [ | 359 $installFunctions(global, DONT_ENUM, [ |
360 "escape", URIEscapeJS, | 360 "escape", URIEscapeJS, |
361 "unescape", URIUnescapeJS, | 361 "unescape", URIUnescapeJS, |
362 "decodeURI", URIDecode, | 362 "decodeURI", URIDecode, |
363 "decodeURIComponent", URIDecodeComponent, | 363 "decodeURIComponent", URIDecodeComponent, |
364 "encodeURI", URIEncode, | 364 "encodeURI", URIEncode, |
365 "encodeURIComponent", URIEncodeComponent | 365 "encodeURIComponent", URIEncodeComponent |
366 ]); | 366 ]); |
367 | 367 |
368 })(); | 368 }) |
OLD | NEW |