2727#include "ecma-globals.h"
2828#include "ecma-helpers.h"
2929#include "ecma-iterator-object.h"
30+ #include "ecma-number-object.h"
3031#include "ecma-objects.h"
3132#include "ecma-try-catch-macro.h"
3233#include "ecma-typedarray-object.h"
@@ -1985,13 +1986,11 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
19851986 ecma_number_t element_num = ecma_get_typedarray_element (typedarray_buffer_p + index , class_id );
19861987 ecma_value_t element_value = ecma_make_number_value (element_num );
19871988
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 );
19891990
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 ));
19951994
19961995 ecma_object_t * element_obj_p = ecma_get_object_from_value (element_obj );
19971996
@@ -2000,7 +1999,6 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
20001999
20012000 if (ECMA_IS_VALUE_ERROR (func_value ))
20022001 {
2003- ecma_free_value (element_value );
20042002 ecma_deref_object (element_obj_p );
20052003 return func_value ;
20062004 }
@@ -2017,12 +2015,12 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
20172015
20182016 if (ECMA_IS_VALUE_ERROR (call_value ))
20192017 {
2020- ecma_free_value (element_value );
20212018 ecma_deref_object (element_obj_p );
20222019 return call_value ;
20232020 }
20242021
20252022 ret_value = ecma_op_to_string (call_value );
2023+ ecma_free_value (call_value );
20262024 }
20272025 else
20282026 {
@@ -2031,7 +2029,6 @@ ecma_builtin_typedarray_prototype_to_locale_string_helper (ecma_object_t *this_o
20312029 }
20322030
20332031 ecma_deref_object (element_obj_p );
2034- ecma_free_value (element_value );
20352032
20362033 return ret_value ;
20372034} /* ecma_builtin_typedarray_prototype_to_locale_string_helper */
@@ -2078,7 +2075,7 @@ ecma_builtin_typedarray_prototype_to_locale_string (ecma_value_t this_arg) /**<
20782075
20792076 if (ECMA_IS_VALUE_ERROR (next_element ))
20802077 {
2081- ecma_free_value ( first_element );
2078+ ecma_deref_ecma_string ( return_string_p );
20822079 return next_element ;
20832080 }
20842081
@@ -2087,8 +2084,6 @@ ecma_builtin_typedarray_prototype_to_locale_string (ecma_value_t this_arg) /**<
20872084 ecma_deref_ecma_string (next_element_p );
20882085 }
20892086
2090- ecma_free_value (first_element );
2091-
20922087 return ecma_make_string_value (return_string_p );
20932088} /* ecma_builtin_typedarray_prototype_to_locale_string */
20942089
0 commit comments