Fix for misinterpretation of data types in XML
This was SVN commit r1512.
This commit is contained in:
parent
851a30215f
commit
da4c42ef58
@ -250,14 +250,19 @@ jsval JSParseString( const CStrW& Native )
|
||||
CParserLine result;
|
||||
result.ParseString( stringParser, (CStr)Native );
|
||||
bool boolResult; int intResult; float floatResult;
|
||||
|
||||
if( result.GetArgFloat( 0, floatResult ) )
|
||||
{
|
||||
if( floatResult == floor( floatResult ) )
|
||||
{
|
||||
intResult = (int)floatResult;
|
||||
if( INT_FITS_IN_JSVAL( intResult ) )
|
||||
return( ToJSVal( intResult ) );
|
||||
}
|
||||
return( ToJSVal( floatResult ) );
|
||||
}
|
||||
if( result.GetArgBool( 0, boolResult ) )
|
||||
return( BOOLEAN_TO_JSVAL( boolResult ) );
|
||||
if( result.GetArgInt( 0, intResult ) )
|
||||
{
|
||||
if( INT_FITS_IN_JSVAL( intResult ) )
|
||||
return( ToJSVal( intResult ) );
|
||||
}
|
||||
if( result.GetArgFloat( 0, floatResult ) )
|
||||
return( ToJSVal( floatResult ) );
|
||||
|
||||
return( ToJSVal( Native ) );
|
||||
}
|
Loading…
Reference in New Issue
Block a user