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:
Jeff Walden
2011-12-01 19:35:44 -08:00
parent 0c1c9fe724
commit 477d66175a
22 changed files with 113 additions and 108 deletions

View File

@@ -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;