(property_name = JS_GetStringBytes(JSVAL_TO_STRING(idval)))) {
(property_name = JS_GetStringBytes(JSVAL_TO_STRING(idval))) != NULL) {
access_java_array_element(JSContext *cx,                          JNIEnv *jEnv,                          JSObject *obj,                          jsid id,                          jsval *vp,                          JSBool do_assignment){    jsval idval;    jarray java_array;    JavaClassDescriptor *class_descriptor;    JavaObjectWrapper *java_wrapper;    jsize array_length, index;    JavaSignature *array_component_signature;        /* printf("In JavaArray_getProperty\n"); */        java_wrapper = JS_GetPrivate(cx, obj);    if (!java_wrapper) {        const char *property_name;        if (JS_IdToValue(cx, id, &idval) && JSVAL_IS_STRING(idval) &&            (property_name = JS_GetStringBytes(JSVAL_TO_STRING(idval)))) {            if (!strcmp(property_name, "constructor")) {                *vp = JSVAL_VOID;                return JS_TRUE;            }        }        JS_ReportError(cx, "illegal operation on JavaArray prototype object");        return JS_FALSE;    }    class_descriptor = java_wrapper->class_descriptor;    java_array = java_wrapper->java_obj;        PR_ASSERT(class_descriptor->type == JAVA_SIGNATURE_ARRAY);    JS_IdToValue(cx, id, &idval);    if (!JSVAL_IS_INT(idval))        idval = try_convert_to_jsint(cx, idval);    if (!JSVAL_IS_INT(idval)) {        /*         * Usually, properties of JavaArray objects are indexed by integers, but         * Java arrays also inherit all the methods of java.lang.Object, so a         * string-valued property is also possible.         */        if (JSVAL_IS_STRING(idval)) {            const char *member_name;                        member_name = JS_GetStringBytes(JSVAL_TO_STRING(idval));                        if (do_assignment) {                JSVersion version = JS_GetVersion(cx);                if (!JSVERSION_IS_ECMA(version)) {                     JS_ReportError(cx, "Attempt to write to invalid Java array "                                       "element \"%s\"", member_name);                    return JS_FALSE;                } else {                    *vp = JSVAL_VOID;                    return JS_TRUE;                }            } else {                if (!strcmp(member_name, "length")) {                    array_length = jsj_GetJavaArrayLength(cx, jEnv, java_array);                    if (array_length < 0)                        return JS_FALSE;                    if (vp)                        *vp = INT_TO_JSVAL(array_length);                    return JS_TRUE;                }                /* Check to see if we're reflecting a Java array method */                return JavaObject_getPropertyById(cx, obj, id, vp);            }        }        JS_ReportError(cx, "invalid Java array index expression");        return JS_FALSE;    }        index = JSVAL_TO_INT(idval);#if 0    array_length = jsj_GetJavaArrayLength(cx, jEnv, java_array);    if (array_length < 0)        return JS_FALSE;    /* Just let Java throw an exception instead of checking array bounds here */    if (index < 0 || index >= array_length) {        JS_ReportError(cx, "Java array index %d out of range", index);        return JS_FALSE;    }#endif    array_component_signature = class_descriptor->array_component_signature;    if (!vp)        return JS_TRUE;    if (do_assignment) {        return jsj_SetJavaArrayElement(cx, jEnv, java_array, index,                                       array_component_signature, *vp);    } else {        return jsj_GetJavaArrayElement(cx, jEnv, java_array, index,                                       array_component_signature, vp);    }}