Use ecma_number_t instead of double where possible (#2330)
Some code paths explicitly used double instead of ecma_number_t even though the values assigned from or compared to were of type ecma_value_t. Related to #2251 JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -303,7 +303,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this
|
||||
* cases that can cause incorrect results due to precision issues, so we use a loop instead.
|
||||
*/
|
||||
magnitude = 0;
|
||||
double counter = this_arg_number;
|
||||
ecma_number_t counter = this_arg_number;
|
||||
while (counter >= radix)
|
||||
{
|
||||
counter /= radix;
|
||||
|
||||
@@ -680,7 +680,7 @@ ecma_builtin_typedarray_prototype_set (ecma_value_t this_arg, /**< this argument
|
||||
{
|
||||
target_offset_num = 0;
|
||||
}
|
||||
if (target_offset_num <= -1.0 || target_offset_num >= (double) UINT32_MAX + 0.5)
|
||||
if (target_offset_num <= -1.0 || target_offset_num >= (ecma_number_t) UINT32_MAX + 0.5)
|
||||
{
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid offset"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user