Fixing sign of converted number in ecma_zt_string_to_number.
This commit is contained in:
@@ -186,9 +186,16 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (begin_p > end_p)
|
if (begin_p > end_p)
|
||||||
|
{
|
||||||
|
if (sign)
|
||||||
|
{
|
||||||
|
return -num;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int32_t e = 0;
|
int32_t e = 0;
|
||||||
|
|
||||||
@@ -197,9 +204,16 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
|||||||
begin_p++;
|
begin_p++;
|
||||||
|
|
||||||
if (begin_p > end_p)
|
if (begin_p > end_p)
|
||||||
|
{
|
||||||
|
if (sign)
|
||||||
|
{
|
||||||
|
return -num;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (begin_p <= end_p)
|
while (begin_p <= end_p)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user