27
27
#include "ecma-globals.h"
28
28
#include "ecma-helpers.h"
29
29
#include "ecma-iterator-object.h"
30
+ #include "ecma-number-object.h"
30
31
#include "ecma-objects.h"
31
32
#include "ecma-try-catch-macro.h"
32
33
#include "ecma-typedarray-object.h"
@@ -1985,13 +1986,11 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
1985
1986
ecma_number_t element_num = ecma_get_typedarray_element (typedarray_buffer_p + index , class_id );
1986
1987
ecma_value_t element_value = ecma_make_number_value (element_num );
1987
1988
1988
- ecma_value_t element_obj = ecma_op_to_object (element_value );
1989
+ ecma_value_t element_obj = ecma_op_create_number_object (element_value );
1989
1990
1990
- if (ECMA_IS_VALUE_ERROR (element_obj ))
1991
- {
1992
- ecma_free_value (element_value );
1993
- return element_obj ;
1994
- }
1991
+ ecma_free_value (element_value );
1992
+
1993
+ JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (element_obj ));
1995
1994
1996
1995
ecma_object_t * element_obj_p = ecma_get_object_from_value (element_obj );
1997
1996
@@ -2000,7 +1999,6 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
2000
1999
2001
2000
if (ECMA_IS_VALUE_ERROR (func_value ))
2002
2001
{
2003
- ecma_free_value (element_value );
2004
2002
ecma_deref_object (element_obj_p );
2005
2003
return func_value ;
2006
2004
}
@@ -2017,12 +2015,12 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
2017
2015
2018
2016
if (ECMA_IS_VALUE_ERROR (call_value ))
2019
2017
{
2020
- ecma_free_value (element_value );
2021
2018
ecma_deref_object (element_obj_p );
2022
2019
return call_value ;
2023
2020
}
2024
2021
2025
2022
ret_value = ecma_op_to_string (call_value );
2023
+ ecma_free_value (call_value );
2026
2024
}
2027
2025
else
2028
2026
{
@@ -2031,7 +2029,6 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
2031
2029
}
2032
2030
2033
2031
ecma_deref_object (element_obj_p );
2034
- ecma_free_value (element_value );
2035
2032
2036
2033
return ret_value ;
2037
2034
} /* ecma_builtin_typedarray_prototype_to_locale_string_helper */
@@ -2078,7 +2075,7 @@ ecma_builtin_typedarray_prototype_to_locale_string (ecma_value_t this_arg) /**<
2078
2075
2079
2076
if (ECMA_IS_VALUE_ERROR (next_element ))
2080
2077
{
2081
- ecma_free_value ( first_element );
2078
+ ecma_deref_ecma_string ( return_string_p );
2082
2079
return next_element ;
2083
2080
}
2084
2081
@@ -2087,8 +2084,6 @@ ecma_builtin_typedarray_prototype_to_locale_string (ecma_value_t this_arg) /**<
2087
2084
ecma_deref_ecma_string (next_element_p );
2088
2085
}
2089
2086
2090
- ecma_free_value (first_element );
2091
-
2092
2087
return ecma_make_string_value (return_string_p );
2093
2088
} /* ecma_builtin_typedarray_prototype_to_locale_string */
2094
2089
0 commit comments