JSString *str, *str1;
JSString *str;
str_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){    JSString *str, *str1;    jsint slot;    if (!JSVAL_IS_INT(id))        return JS_TRUE;    str = js_ValueToString(cx, OBJECT_TO_JSVAL(obj));    if (!str)        return JS_FALSE;    slot = JSVAL_TO_INT(id);    if (slot == STRING_LENGTH) {        *vp = INT_TO_JSVAL((jsint) JSSTRING_LENGTH(str));    } else {        /*         * ECMA extension: if the property has not been set already (possibly         * to a user-defined value), return as its value the character at the         * given index.  Don't use resolve, which penalizes all string method         * calls and other property accesses.  Let the property attributes be         * the default, so the user can override, enumerate, etc. and get the         * expected results.         */        if (JSVAL_IS_VOID(*vp) && (size_t)slot < JSSTRING_LENGTH(str)) {            str1 = js_NewDependentString(cx, str, (size_t)slot, 1, 0);            if (!str1)                return JS_FALSE;            *vp = STRING_TO_JSVAL(str1);        }    }    return JS_TRUE;}