Introducing ecma_is_value_{number,string,object} for checking type of ecma-value.

This commit is contained in:
Ruben Ayrapetyan
2014-11-19 17:39:54 +03:00
parent 30ff59fca3
commit 7b3eaf146b
25 changed files with 117 additions and 78 deletions
+2 -2
View File
@@ -125,8 +125,8 @@ opfunc_addition (opcode_t opdata, /**< operation data */
ECMA_TRY_CATCH (prim_left_value, ecma_op_to_primitive (left_value.u.value, ECMA_PREFERRED_TYPE_NO), ret_value);
ECMA_TRY_CATCH (prim_right_value, ecma_op_to_primitive (right_value.u.value, ECMA_PREFERRED_TYPE_NO), ret_value);
if (prim_left_value.u.value.value_type == ECMA_TYPE_STRING
|| prim_right_value.u.value.value_type == ECMA_TYPE_STRING)
if (ecma_is_value_string (prim_left_value.u.value)
|| ecma_is_value_string (prim_right_value.u.value))
{
ECMA_TRY_CATCH (str_left_value, ecma_op_to_string (prim_left_value.u.value), ret_value);
ECMA_TRY_CATCH (str_right_value, ecma_op_to_string (prim_right_value.u.value), ret_value);