2010-08-11 17:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/classes.c
+ extended error messages in __CLSINSTSUPER() function to show the name
of super class which cannot be created
* harbour/src/rtl/tclass.prg
* force RTE for superclasses defined using function declared as DYNAMIC
It should help in locating the problem in wrongly linked code, i.e.
without some superclasses.
This commit is contained in:
@@ -16,6 +16,16 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-08-11 17:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/src/vm/classes.c
|
||||
+ extended error messages in __CLSINSTSUPER() function to show the name
|
||||
of super class which cannot be created
|
||||
|
||||
* harbour/src/rtl/tclass.prg
|
||||
* force RTE for superclasses defined using function declared as DYNAMIC
|
||||
It should help in locating the problem in wrongly linked code, i.e.
|
||||
without some superclasses.
|
||||
|
||||
2010-08-11 12:28 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/src/rtl/empty.c
|
||||
* modified EMPTY() function behavior so now for symbols
|
||||
|
||||
@@ -172,21 +172,19 @@ STATIC FUNCTION New( cClassName, xSuper, sClassFunc, lModuleFriendly )
|
||||
|
||||
DEFAULT lModuleFriendly TO .F.
|
||||
|
||||
IF Empty( xSuper )
|
||||
IF hb_isSymbol( xSuper )
|
||||
::asSuper := { xSuper }
|
||||
ELSEIF Empty( xSuper )
|
||||
::asSuper := {}
|
||||
ELSEIF ISCHARACTER( xSuper )
|
||||
::asSuper := { __DynsN2Sym( xSuper ) }
|
||||
ELSEIF hb_isSymbol( xSuper )
|
||||
::asSuper := { xSuper }
|
||||
ELSEIF ISARRAY( xSuper )
|
||||
::asSuper := {}
|
||||
FOR EACH i IN xSuper
|
||||
IF ! Empty( i )
|
||||
IF ISCHARACTER( i )
|
||||
AAdd( ::asSuper, __DynsN2Sym( i ) )
|
||||
ELSEIF hb_isSymbol( i )
|
||||
AAdd( ::asSuper, i )
|
||||
ENDIF
|
||||
IF hb_isSymbol( i )
|
||||
AAdd( ::asSuper, i )
|
||||
ELSEIF ISCHARACTER( i ) .AND. ! Empty( i )
|
||||
AAdd( ::asSuper, __DynsN2Sym( i ) )
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
@@ -3751,6 +3751,7 @@ HB_FUNC( __CLSINSTSUPER )
|
||||
PHB_ITEM pItem = hb_param( 1, HB_IT_STRING | HB_IT_SYMBOL );
|
||||
HB_USHORT uiClassH = 0, uiClass;
|
||||
PHB_SYMB pClassFuncSym = NULL;
|
||||
char szDesc[ 128 ];
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -3809,12 +3810,28 @@ HB_FUNC( __CLSINSTSUPER )
|
||||
if( uiClassH && HB_IS_OBJECT( pObject ) )
|
||||
pObject->item.asArray.value->uiClass = 0;
|
||||
else if( hb_vmRequestQuery() == 0 )
|
||||
{
|
||||
hb_snprintf( szDesc, sizeof( szDesc ),
|
||||
"Super class '%s' does not return an object",
|
||||
pClassFuncSym->szName );
|
||||
hb_errRT_BASE( EG_ARG, 3002, "Super class does not return an object", HB_ERR_FUNCNAME, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_ARG, 3003, "Cannot find super class", HB_ERR_FUNCNAME, 0 );
|
||||
{
|
||||
const char * pszName = NULL;
|
||||
|
||||
pClassFuncSym = hb_itemGetSymbol( pItem );
|
||||
if( pClassFuncSym )
|
||||
pszName = pClassFuncSym->szName;
|
||||
else
|
||||
pszName = hb_itemGetCPtr( pItem );
|
||||
hb_snprintf( szDesc, sizeof( szDesc ),
|
||||
"Cannot find super class '%s'", pszName );
|
||||
hb_errRT_BASE( EG_ARG, 3003, szDesc, HB_ERR_FUNCNAME, 0 );
|
||||
}
|
||||
|
||||
hb_retni( uiClassH );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user