| 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(global, utils) { | 8 (function(global, utils) { |
| 9 | 9 |
| 10 "use strict"; | 10 "use strict"; |
| 11 | 11 |
| 12 %CheckIsBootstrapping(); | 12 %CheckIsBootstrapping(); |
| 13 | 13 |
| 14 //- ------------------------------------------------------------------ | 14 //- ------------------------------------------------------------------ |
| 15 // Imports | 15 // Imports |
| 16 | 16 |
| 17 var GlobalObject = global.Object; | 17 var GlobalObject = global.Object; |
| 18 var GlobalArray = global.Array; | 18 var GlobalArray = global.Array; |
| 19 var InternalArray = utils.InternalArray; | 19 var InternalArray = utils.InternalArray; |
| 20 var MakeURIError; |
| 21 |
| 22 utils.Import(function(from) { |
| 23 MakeURIError = from.MakeURIError; |
| 24 }); |
| 25 |
| 20 | 26 |
| 21 // ------------------------------------------------------------------- | 27 // ------------------------------------------------------------------- |
| 22 // Define internal helper functions. | 28 // Define internal helper functions. |
| 23 | 29 |
| 24 function HexValueOf(code) { | 30 function HexValueOf(code) { |
| 25 // 0-9 | 31 // 0-9 |
| 26 if (code >= 48 && code <= 57) return code - 48; | 32 if (code >= 48 && code <= 57) return code - 48; |
| 27 // A-F | 33 // A-F |
| 28 if (code >= 65 && code <= 70) return code - 55; | 34 if (code >= 65 && code <= 70) return code - 55; |
| 29 // a-f | 35 // a-f |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 utils.InstallFunctions(global, DONT_ENUM, [ | 371 utils.InstallFunctions(global, DONT_ENUM, [ |
| 366 "escape", URIEscapeJS, | 372 "escape", URIEscapeJS, |
| 367 "unescape", URIUnescapeJS, | 373 "unescape", URIUnescapeJS, |
| 368 "decodeURI", URIDecode, | 374 "decodeURI", URIDecode, |
| 369 "decodeURIComponent", URIDecodeComponent, | 375 "decodeURIComponent", URIDecodeComponent, |
| 370 "encodeURI", URIEncode, | 376 "encodeURI", URIEncode, |
| 371 "encodeURIComponent", URIEncodeComponent | 377 "encodeURIComponent", URIEncodeComponent |
| 372 ]); | 378 ]); |
| 373 | 379 |
| 374 }) | 380 }) |
| OLD | NEW |