*localvp = localv;
convert_JS_method_args_to_java_argv(JSContext *cx, JNIEnv *jEnv, jsval *argv,			            JavaMethodSpec *method, JSBool **localvp){    jvalue *jargv;    JSBool ok, *localv;    uintN i, argc;    JavaSignature **arg_signatures;    JavaMethodSignature *signature;            signature = &method->signature;    argc = signature->num_args;    PR_ASSERT(argc != 0);    arg_signatures = signature->arg_signatures;        jargv = (jvalue *)JS_malloc(cx, sizeof(jvalue) * argc);        if (!jargv)        return NULL;    /*     * Allocate an array that contains a flag for each argument, indicating whether     * or not the conversion from a JS value to a Java value resulted in a new     * JNI local reference.     */    localv = (JSBool *)JS_malloc(cx, sizeof(JSBool) * argc);    if (!localv) {        JS_free(cx, jargv);        return NULL;    }    *localvp = localv;        for (i = 0; i < argc; i++) {        int dummy_cost;                ok = jsj_ConvertJSValueToJavaValue(cx, jEnv, argv[i], arg_signatures[i],                                           &dummy_cost, &jargv[i], &localv[i]);        if (!ok) {            JS_ReportError(cx, "Internal error: can't convert JS value to Java value");            JS_free(cx, jargv);            JS_free(cx, localv);            return NULL;        }    }    return jargv;}  