Bug 707061 - Rename js_ValueToString to ToString. Also, consistent with ToObject, make ToString include an inline already-string fast path, and make ToStringSlow be an out-of-line slow path for the case where the value is not a string (asserting that this is the case). r=luke
This commit is contained in:
@@ -1870,7 +1870,7 @@ array_join(JSContext *cx, uintN argc, Value *vp)
|
||||
if (args.length() == 0 || args[0].isUndefined()) {
|
||||
str = NULL;
|
||||
} else {
|
||||
str = js_ValueToString(cx, args[0]);
|
||||
str = ToString(cx, args[0]);
|
||||
if (!str)
|
||||
return JS_FALSE;
|
||||
args[0].setString(str);
|
||||
@@ -2177,7 +2177,7 @@ js::array_sort(JSContext *cx, uintN argc, Value *vp)
|
||||
if (!JS_CHECK_OPERATION_LIMIT(cx))
|
||||
return false;
|
||||
const Value &v = vec[i];
|
||||
JSString *str = js_ValueToString(cx, v);
|
||||
JSString *str = ToString(cx, v);
|
||||
if (!str)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user