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

@@ -321,7 +321,7 @@ num_parseFloat(JSContext *cx, uintN argc, Value *vp)
vp->setDouble(js_NaN);
return JS_TRUE;
}
str = js_ValueToString(cx, vp[2]);
str = ToString(cx, vp[2]);
if (!str)
return JS_FALSE;
bp = str->getChars(cx);
@@ -438,7 +438,7 @@ num_parseInt(JSContext *cx, uintN argc, Value *vp)
}
/* Step 1. */
JSString *inputString = js_ValueToString(cx, args[0]);
JSString *inputString = ToString(cx, args[0]);
if (!inputString)
return false;
args[0].setString(inputString);