JS_ReportError(cx, "can't XDR class %s", clasp->name);
JS_ReportErrorNumber(cx, NULL, JSMSG_CANT_XDR_CLASS, clasp->name);
js_XDRObject(JSXDRState *xdr, JSObject **objp){    JSContext *cx;    JSClass *clasp;    char *className;    uint32 classId, classDef;    JSBool ok;    JSObject *proto;    cx = xdr->cx;    if (xdr->mode == JSXDR_ENCODE) {	clasp = OBJ_GET_CLASS(cx, *objp);	className = clasp->name;	classId = JS_FindClassIdByName(xdr, className);	classDef = !classId;	if (classDef && !JS_RegisterClass(xdr, clasp, &classId))	    return JS_FALSE;    } else {	classDef = 0;	className = NULL;    }    /* XDR a flag word followed (if true) by the class name. */    if (!JS_XDRUint32(xdr, &classDef))	return JS_FALSE;    if (classDef && !JS_XDRCString(xdr, &className))	return JS_FALSE;    /* From here on, return through out: to free className if it was set. */    ok = JS_XDRUint32(xdr, &classId);    if (!ok)	goto out;    if (xdr->mode != JSXDR_ENCODE) {	if (classDef) {	    ok = js_GetClassPrototype(cx, className, &proto);	    if (!ok)		goto out;	    clasp = OBJ_GET_CLASS(cx, proto);	    ok = JS_RegisterClass(xdr, clasp, &classId);	    if (!ok)		goto out;	} else {	    clasp = JS_FindClassById(xdr, classId);	    if (!clasp) {		JS_ReportError(cx, "can't find class id %ld", (long)classId);		ok = JS_FALSE;		goto out;	    }	}    }    if (!clasp->xdrObject) {	JS_ReportError(cx, "can't XDR class %s", clasp->name);	ok = JS_FALSE;    } else {	ok = clasp->xdrObject(xdr, objp);    }out:    if (xdr->mode != JSXDR_ENCODE && className)	JS_free(cx, className);    return ok;}