зеркало из https://github.com/mozilla/pjs.git
Bug 409302. js_DoubleToECMA(u)Int32 has an unused cx param. r/a=brendan
This commit is contained in:
Родитель
d3afb1c62d
Коммит
a0f875cbe6
|
@ -149,7 +149,7 @@ ValueIsLength(JSContext *cx, jsval v, jsuint *lengthp)
|
|||
JSMSG_BAD_ARRAY_LENGTH);
|
||||
return JS_FALSE;
|
||||
}
|
||||
if (!js_DoubleToECMAUint32(cx, d, (uint32 *)lengthp)) {
|
||||
if (!js_DoubleToECMAUint32(d, (uint32 *)lengthp)) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
|
||||
JSMSG_BAD_ARRAY_LENGTH);
|
||||
return JS_FALSE;
|
||||
|
|
|
@ -761,11 +761,11 @@ js_ValueToECMAInt32(JSContext *cx, jsval v, int32 *ip)
|
|||
|
||||
if (!js_ValueToNumber(cx, v, &d))
|
||||
return JS_FALSE;
|
||||
return js_DoubleToECMAInt32(cx, d, ip);
|
||||
return js_DoubleToECMAInt32(d, ip);
|
||||
}
|
||||
|
||||
JSBool
|
||||
js_DoubleToECMAInt32(JSContext *cx, jsdouble d, int32 *ip)
|
||||
js_DoubleToECMAInt32(jsdouble d, int32 *ip)
|
||||
{
|
||||
jsdouble two32 = 4294967296.0;
|
||||
jsdouble two31 = 2147483648.0;
|
||||
|
@ -790,11 +790,11 @@ js_ValueToECMAUint32(JSContext *cx, jsval v, uint32 *ip)
|
|||
|
||||
if (!js_ValueToNumber(cx, v, &d))
|
||||
return JS_FALSE;
|
||||
return js_DoubleToECMAUint32(cx, d, ip);
|
||||
return js_DoubleToECMAUint32(d, ip);
|
||||
}
|
||||
|
||||
JSBool
|
||||
js_DoubleToECMAUint32(JSContext *cx, jsdouble d, uint32 *ip)
|
||||
js_DoubleToECMAUint32(jsdouble d, uint32 *ip)
|
||||
{
|
||||
JSBool neg;
|
||||
jsdouble two32 = 4294967296.0;
|
||||
|
|
|
@ -211,7 +211,7 @@ extern JSBool
|
|||
js_ValueToECMAInt32(JSContext *cx, jsval v, int32 *ip);
|
||||
|
||||
extern JSBool
|
||||
js_DoubleToECMAInt32(JSContext *cx, jsdouble d, int32 *ip);
|
||||
js_DoubleToECMAInt32(jsdouble d, int32 *ip);
|
||||
|
||||
/*
|
||||
* Convert a value or a double to a uint32, according to the ECMA rules
|
||||
|
@ -221,7 +221,7 @@ extern JSBool
|
|||
js_ValueToECMAUint32(JSContext *cx, jsval v, uint32 *ip);
|
||||
|
||||
extern JSBool
|
||||
js_DoubleToECMAUint32(JSContext *cx, jsdouble d, uint32 *ip);
|
||||
js_DoubleToECMAUint32(jsdouble d, uint32 *ip);
|
||||
|
||||
/*
|
||||
* Convert a value to a number, then to an int32 if it fits by rounding to
|
||||
|
|
|
@ -5904,18 +5904,18 @@ FoldBinaryNumeric(JSContext *cx, JSOp op, JSParseNode *pn1, JSParseNode *pn2,
|
|||
switch (op) {
|
||||
case JSOP_LSH:
|
||||
case JSOP_RSH:
|
||||
if (!js_DoubleToECMAInt32(cx, d, &i))
|
||||
if (!js_DoubleToECMAInt32(d, &i))
|
||||
return JS_FALSE;
|
||||
if (!js_DoubleToECMAInt32(cx, d2, &j))
|
||||
if (!js_DoubleToECMAInt32(d2, &j))
|
||||
return JS_FALSE;
|
||||
j &= 31;
|
||||
d = (op == JSOP_LSH) ? i << j : i >> j;
|
||||
break;
|
||||
|
||||
case JSOP_URSH:
|
||||
if (!js_DoubleToECMAUint32(cx, d, &u))
|
||||
if (!js_DoubleToECMAUint32(d, &u))
|
||||
return JS_FALSE;
|
||||
if (!js_DoubleToECMAInt32(cx, d2, &j))
|
||||
if (!js_DoubleToECMAInt32(d2, &j))
|
||||
return JS_FALSE;
|
||||
j &= 31;
|
||||
d = u >> j;
|
||||
|
@ -6525,7 +6525,7 @@ js_FoldConstants(JSContext *cx, JSParseNode *pn, JSTreeContext *tc)
|
|||
d = pn1->pn_dval;
|
||||
switch (pn->pn_op) {
|
||||
case JSOP_BITNOT:
|
||||
if (!js_DoubleToECMAInt32(cx, d, &i))
|
||||
if (!js_DoubleToECMAInt32(d, &i))
|
||||
return JS_FALSE;
|
||||
d = ~i;
|
||||
break;
|
||||
|
|
|
@ -1846,7 +1846,7 @@ str_split(JSContext *cx, uintN argc, jsval *vp)
|
|||
return JS_FALSE;
|
||||
|
||||
/* Clamp limit between 0 and 1 + string length. */
|
||||
if (!js_DoubleToECMAUint32(cx, d, &limit))
|
||||
if (!js_DoubleToECMAUint32(d, &limit))
|
||||
return JS_FALSE;
|
||||
if (limit > JSSTRING_LENGTH(str))
|
||||
limit = 1 + JSSTRING_LENGTH(str);
|
||||
|
|
Загрузка…
Ссылка в новой задаче