Index: src/uri.js |
diff --git a/src/uri.js b/src/uri.js |
index bf3270f1d061dc8f63e1f4397a9288ee64f47532..bdb83d14310e2f1a8eef60eb30606376d6fb9871 100644 |
--- a/src/uri.js |
+++ b/src/uri.js |
@@ -17,11 +17,6 @@ |
var GlobalObject = global.Object; |
var GlobalArray = global.Array; |
var InternalArray = utils.InternalArray; |
-var ToString; |
- |
-utils.Import(function(from) { |
- ToString = from.ToString; |
-}); |
// ------------------------------------------------------------------- |
// Define internal helper functions. |
@@ -169,7 +164,7 @@ function URIDecodeOctets(octets, result, index) { |
// ECMA-262, section 15.1.3 |
function Encode(uri, unescape) { |
- uri = TO_STRING_INLINE(uri); |
+ uri = TO_STRING(uri); |
var uriLength = uri.length; |
var array = new InternalArray(uriLength); |
var index = 0; |
@@ -200,7 +195,7 @@ function Encode(uri, unescape) { |
// ECMA-262, section 15.1.3 |
function Decode(uri, reserved) { |
- uri = TO_STRING_INLINE(uri); |
+ uri = TO_STRING(uri); |
var uriLength = uri.length; |
var one_byte = %NewString(uriLength, NEW_ONE_BYTE_STRING); |
var index = 0; |
@@ -278,14 +273,12 @@ function Decode(uri, reserved) { |
// Define exported functions. |
// ECMA-262 - B.2.1. |
-function URIEscapeJS(str) { |
- var s = ToString(str); |
+function URIEscapeJS(s) { |
return %URIEscape(s); |
} |
// ECMA-262 - B.2.2. |
-function URIUnescapeJS(str) { |
- var s = ToString(str); |
+function URIUnescapeJS(s) { |
return %URIUnescape(s); |
} |
@@ -309,15 +302,13 @@ function URIDecode(uri) { |
return false; |
}; |
- var string = ToString(uri); |
- return Decode(string, reservedPredicate); |
+ return Decode(uri, reservedPredicate); |
} |
// ECMA-262 - 15.1.3.2. |
function URIDecodeComponent(component) { |
var reservedPredicate = function(cc) { return false; }; |
- var string = ToString(component); |
- return Decode(string, reservedPredicate); |
+ return Decode(component, reservedPredicate); |
} |
// ECMA-262 - 15.1.3.3. |
@@ -343,8 +334,7 @@ function URIEncode(uri) { |
return false; |
}; |
- var string = ToString(uri); |
- return Encode(string, unescapePredicate); |
+ return Encode(uri, unescapePredicate); |
} |
// ECMA-262 - 15.1.3.4 |
@@ -364,8 +354,7 @@ function URIEncodeComponent(component) { |
return false; |
}; |
- var string = ToString(component); |
- return Encode(string, unescapePredicate); |
+ return Encode(component, unescapePredicate); |
} |
// ------------------------------------------------------------------- |