JS_ReportError(xdr->cx, "unknown jsval type %#lx for XDR", type);
sprintf(numBuf, "%#lx", type); JS_ReportErrorNumber(xdr->cx, NULL, JSMSG_BAD_JVAL_TYPE, type); }
JS_XDRValue(JSXDRState *xdr, jsval *vp){    uint32 type = JSVAL_TAG(*vp);    if (!JS_XDRUint32(xdr, &type))	return JS_FALSE;    switch (type) {      case JSVAL_STRING: {	JSString *str = JSVAL_TO_STRING(*vp);	if (!JS_XDRString(xdr, &str))	    return JS_FALSE;	if (xdr->mode == JSXDR_DECODE)	    *vp = STRING_TO_JSVAL(str);	break;      }      case JSVAL_DOUBLE: {	jsdouble *dp;	if (xdr->mode == JSXDR_ENCODE)	    dp = JSVAL_TO_DOUBLE(*vp);	if (!JS_XDRDouble(xdr, &dp))	    return JS_FALSE;	if (xdr->mode == JSXDR_DECODE)	    *vp = DOUBLE_TO_JSVAL(dp);	break;      }      case JSVAL_OBJECT: {	JSObject *obj;	if (xdr->mode == JSXDR_ENCODE)	    obj = JSVAL_TO_OBJECT(*vp);	if (!js_XDRObject(xdr, &obj))	    return JS_FALSE;	if (xdr->mode == JSXDR_DECODE)	    *vp = OBJECT_TO_JSVAL(obj);	break;      }      case JSVAL_BOOLEAN: {        uint32 b;	if (xdr->mode == JSXDR_ENCODE)	    b = (uint32)JSVAL_TO_BOOLEAN(*vp);	if (!JS_XDRUint32(xdr, &b))	    return JS_FALSE;	if (xdr->mode == JSXDR_DECODE)	    *vp = BOOLEAN_TO_JSVAL((JSBool)b);	break;      }      case JSVAL_VOID:	if (!JS_XDRUint32(xdr, (uint32 *)vp))	    return JS_FALSE;	break;      default:	if (type & JSVAL_INT) {	    uint32 i;	    if (xdr->mode == JSXDR_ENCODE)		i = JSVAL_TO_INT(*vp);	    if (!JS_XDRUint32(xdr, &i))		return JS_FALSE;	    if (xdr->mode == JSXDR_DECODE)		*vp = INT_TO_JSVAL(i);	    break;	}	JS_ReportError(xdr->cx, "unknown jsval type %#lx for XDR", type);	return JS_FALSE;    }    return JS_TRUE;}