int32 i;
jsdouble d = 0.0;
str_charAt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){    JSString *str;    int32 i;    size_t index;    jschar buf[2];    str = js_ValueToString(cx, OBJECT_TO_JSVAL(obj));    if (!str)	return JS_FALSE;    argv[-1] = STRING_TO_JSVAL(str);    if (!js_ValueToECMAInt32(cx, argv[0], &i))	return JS_FALSE;    if (i < 0 || str->length <= (size_t)i) {	*rval = JS_GetEmptyStringValue(cx);    } else {	index = (size_t)i;	buf[0] = str->chars[index];	buf[1] = 0;	str = js_NewStringCopyN(cx, buf, 1, 0);	if (!str)	    return JS_FALSE;	*rval = STRING_TO_JSVAL(str);    }    return JS_TRUE;}