Bug 671143 - Rename ValueToNumber to ToNumber, to be more like the spec nomenclature. r=cdleary

This commit is contained in:
Jeff Walden
2011-06-13 21:49:59 -07:00
parent 866e25d48b
commit 0cb11915d2
15 changed files with 83 additions and 111 deletions

View File

@@ -285,7 +285,7 @@ num_isNaN(JSContext *cx, uintN argc, Value *vp)
return JS_TRUE;
}
jsdouble x;
if (!ValueToNumber(cx, vp[2], &x))
if (!ToNumber(cx, vp[2], &x))
return false;
vp->setBoolean(JSDOUBLE_IS_NaN(x));
return JS_TRUE;
@@ -299,7 +299,7 @@ num_isFinite(JSContext *cx, uintN argc, Value *vp)
return JS_TRUE;
}
jsdouble x;
if (!ValueToNumber(cx, vp[2], &x))
if (!ToNumber(cx, vp[2], &x))
return JS_FALSE;
vp->setBoolean(JSDOUBLE_IS_FINITE(x));
return JS_TRUE;
@@ -571,7 +571,7 @@ Number(JSContext *cx, uintN argc, Value *vp)
bool isConstructing = IsConstructing(vp);
if (argc > 0) {
if (!ValueToNumber(cx, &vp[2]))
if (!ToNumber(cx, &vp[2]))
return false;
vp[0] = vp[2];
} else {
@@ -1290,7 +1290,7 @@ NumberValueToStringBuffer(JSContext *cx, const Value &v, StringBuffer &sb)
}
bool
ValueToNumberSlow(JSContext *cx, Value v, double *out)
ToNumberSlow(JSContext *cx, Value v, double *out)
{
JS_ASSERT(!v.isNumber());
goto skip_int_double;
@@ -1336,7 +1336,7 @@ ValueToECMAInt32Slow(JSContext *cx, const Value &v, int32_t *out)
if (v.isDouble()) {
d = v.toDouble();
} else {
if (!ValueToNumberSlow(cx, v, &d))
if (!ToNumberSlow(cx, v, &d))
return false;
}
*out = js_DoubleToECMAInt32(d);
@@ -1351,7 +1351,7 @@ ValueToECMAUint32Slow(JSContext *cx, const Value &v, uint32_t *out)
if (v.isDouble()) {
d = v.toDouble();
} else {
if (!ValueToNumberSlow(cx, v, &d))
if (!ToNumberSlow(cx, v, &d))
return false;
}
*out = js_DoubleToECMAUint32(d);
@@ -1398,7 +1398,7 @@ ValueToInt32Slow(JSContext *cx, const Value &v, int32_t *out)
jsdouble d;
if (v.isDouble()) {
d = v.toDouble();
} else if (!ValueToNumberSlow(cx, v, &d)) {
} else if (!ToNumberSlow(cx, v, &d)) {
return false;
}
@@ -1418,7 +1418,7 @@ ValueToUint16Slow(JSContext *cx, const Value &v, uint16_t *out)
jsdouble d;
if (v.isDouble()) {
d = v.toDouble();
} else if (!ValueToNumberSlow(cx, v, &d)) {
} else if (!ToNumberSlow(cx, v, &d)) {
return false;
}