Refactor ecma_op_to_string (#3171)

Similar to the ecma_op_to_object rework, in this new method we
return directly with the pointer to the ecma string, and we don't
wrap the result into an ecma_value_t

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2019-10-25 15:58:47 +02:00
committed by Robert Fancsik
parent b7aa21ebc7
commit 4b352758c1
25 changed files with 391 additions and 427 deletions
@@ -187,11 +187,11 @@ ecma_builtin_date_parse (ecma_value_t this_arg, /**< this argument */
ecma_number_t date_num = ecma_number_make_nan ();
/* Date Time String fromat (ECMA-262 v5, 15.9.1.15) */
ECMA_TRY_CATCH (date_str_value,
ecma_op_to_string (arg),
ret_value);
ecma_string_t *date_str_p = ecma_get_string_from_value (date_str_value);
ecma_string_t *date_str_p = ecma_op_to_string (arg);
if (JERRY_UNLIKELY (date_str_p == NULL))
{
return ECMA_VALUE_ERROR;
}
ECMA_STRING_TO_UTF8_STRING (date_str_p, date_start_p, date_start_size);
@@ -403,7 +403,7 @@ ecma_builtin_date_parse (ecma_value_t this_arg, /**< this argument */
ret_value = ecma_make_number_value (date_num);
ECMA_FINALIZE_UTF8_STRING (date_start_p, date_start_size);
ECMA_FINALIZE (date_str_value);
ecma_deref_ecma_string (date_str_p);
return ret_value;
} /* ecma_builtin_date_parse */