JS_ReportError(cx, "can't convert %s to an integer",
JS_ReportErrorNumber(cx, NULL, JSMSG_CANT_CONVERT,
js_ValueToInt32(JSContext *cx, jsval v, int32 *ip){    jsdouble d;    JSString *str;    if (!js_ValueToNumber(cx, v, &d))	return JS_FALSE;    if (JSDOUBLE_IS_NaN(d) || d <= -2147483649.0 || 2147483648.0 <= d) {	str = js_DecompileValueGenerator(cx, v, NULL);	if (str) {	    JS_ReportError(cx, "can't convert %s to an integer",			   JS_GetStringBytes(str));	}	return JS_FALSE;    }    *ip = (int32)floor(d + 0.5);     /* Round to nearest */    return JS_TRUE;}