if (!js_NewNumberValue(cx, d, rval)) return JS_FALSE;
if (*chars == '0') {  if ((*(chars + 1) != 0) && (*(++chars) == 'X' || *chars == 'x'))   { chars++; radix = 16; } else {  radix = 8; } } else { radix = 10;  } }   start = chars;  if (radix < 10) { digitMax = (char) ('0' + radix - 1); } else { digitMax = '9'; } if (radix > 10) { lowerCaseBound = (char) ('a' + radix - 10); upperCaseBound = (char) ('A' + radix - 10); } else { lowerCaseBound = 'a'; upperCaseBound = 'A'; } digit = 0;  sum = 0; while ((c = *chars) != 0) { if ('0' <= c && c <= digitMax) newDigit = c - '0'; else if ('a' <= c && c < lowerCaseBound) newDigit = c - 'a' + 10; else if ('A' <= c && c < upperCaseBound) newDigit = c - 'A' + 10; else break;  if (radix == 10 && ++digit > 20) sum = sum*radix; else sum = sum*radix + newDigit; chars++; }  if (chars == start) { *rval = DOUBLE_TO_JSVAL(cx->runtime->jsNaN); } else { if (!js_NewNumberValue(cx, (negative ? -sum : sum), rval)) return JS_FALSE;
num_parseInt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){    JSString *str;    jsint base;    jschar *ep;    jsdouble d;    str = js_ValueToString(cx, argv[0]);    if (!str)	return JS_FALSE;    if (argc > 1) {	if (!js_ValueToECMAInt32(cx, argv[1], &base))	    return JS_FALSE;    } else {	base = 0;    }    if (!js_strtol(str->chars, &ep, base, &d)) {	*rval = DOUBLE_TO_JSVAL(cx->runtime->jsNaN);    } else {	if (!js_NewNumberValue(cx, d, rval))	    return JS_FALSE;    }    return JS_TRUE;}