case nsIDataType::VTYPE_EMPTY_ARRAY:
static nsresult ToManageableNumber(const nsDiscriminatedUnion& inData,                                   nsDiscriminatedUnion* outData){    nsAutoString tempString;    nsresult rv;    switch(inData.mType)    {    // This group results in a PRInt32...#define CASE__NUMBER_INT32(type_, member_)                                    \    case nsIDataType :: type_ :                                               \        outData->u.mInt32Value = inData.u. member_ ;                          \        outData->mType = nsIDataType::VTYPE_INT32;                            \        return NS_OK;    CASE__NUMBER_INT32(VTYPE_INT8,   mInt8Value)    CASE__NUMBER_INT32(VTYPE_INT16,  mInt16Value)    CASE__NUMBER_INT32(VTYPE_INT32,  mInt32Value)    CASE__NUMBER_INT32(VTYPE_UINT8,  mUint8Value)    CASE__NUMBER_INT32(VTYPE_UINT16, mUint16Value)    CASE__NUMBER_INT32(VTYPE_BOOL,   mBoolValue)    CASE__NUMBER_INT32(VTYPE_CHAR,   mCharValue)    CASE__NUMBER_INT32(VTYPE_WCHAR,  mWCharValue)#undef CASE__NUMBER_INT32    // This group results in a PRUint32...    case nsIDataType::VTYPE_UINT32:        outData->u.mInt32Value = inData.u.mUint32Value;        outData->mType = nsIDataType::VTYPE_INT32;        return NS_OK;    // This group results in a double...    case nsIDataType::VTYPE_INT64:    case nsIDataType::VTYPE_UINT64:        // XXX Need boundary checking here.        // We may need to return NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA        LL_L2D(outData->u.mDoubleValue, inData.u.mInt64Value);        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    case nsIDataType::VTYPE_FLOAT:        outData->u.mDoubleValue = inData.u.mFloatValue;        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    case nsIDataType::VTYPE_DOUBLE:        outData->u.mDoubleValue = inData.u.mDoubleValue;        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    case nsIDataType::VTYPE_CHAR_STR:    case nsIDataType::VTYPE_STRING_SIZE_IS:        rv = String2Double(inData.u.str.mStringValue, &outData->u.mDoubleValue);        if(NS_FAILED(rv))            return rv;        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    case nsIDataType::VTYPE_DOMSTRING:    case nsIDataType::VTYPE_ASTRING:        rv = AString2Double(*inData.u.mAStringValue, &outData->u.mDoubleValue);        if(NS_FAILED(rv))            return rv;        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    case nsIDataType::VTYPE_UTF8STRING:        rv = AUTF8String2Double(*inData.u.mUTF8StringValue,                                &outData->u.mDoubleValue);        if(NS_FAILED(rv))            return rv;        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    case nsIDataType::VTYPE_CSTRING:        rv = ACString2Double(*inData.u.mCStringValue,                             &outData->u.mDoubleValue);        if(NS_FAILED(rv))            return rv;        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    case nsIDataType::VTYPE_WCHAR_STR:    case nsIDataType::VTYPE_WSTRING_SIZE_IS:        tempString.Assign(inData.u.wstr.mWStringValue);        rv = AString2Double(tempString, &outData->u.mDoubleValue);        if(NS_FAILED(rv))            return rv;        outData->mType = nsIDataType::VTYPE_DOUBLE;        return NS_OK;    // This group fails...    case nsIDataType::VTYPE_VOID:    case nsIDataType::VTYPE_ID:    case nsIDataType::VTYPE_INTERFACE:    case nsIDataType::VTYPE_INTERFACE_IS:    case nsIDataType::VTYPE_ARRAY:    case nsIDataType::VTYPE_EMPTY:    default:        return NS_ERROR_CANNOT_CONVERT_DATA;    }}