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:
committed by
Robert Fancsik
parent
b7aa21ebc7
commit
4b352758c1
@@ -198,18 +198,16 @@ ecma_builtin_symbol_for (ecma_value_t this_arg, /**< this argument */
|
||||
ecma_value_t key) /**< key string */
|
||||
{
|
||||
JERRY_UNUSED (this_arg);
|
||||
ecma_value_t string_desc = ecma_op_to_string (key);
|
||||
ecma_string_t *string_desc_p = ecma_op_to_string (key);
|
||||
|
||||
/* 1. */
|
||||
if (ECMA_IS_VALUE_ERROR (string_desc))
|
||||
if (JERRY_UNLIKELY (string_desc_p == NULL))
|
||||
{
|
||||
/* 2. */
|
||||
return string_desc;
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
/* 4-7. */
|
||||
JERRY_ASSERT (ecma_is_value_string (string_desc));
|
||||
|
||||
return ecma_builtin_symbol_for_helper (string_desc);
|
||||
return ecma_builtin_symbol_for_helper (ecma_make_string_value (string_desc_p));
|
||||
} /* ecma_builtin_symbol_for */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user