Use 'ecma_make_boolean_value' where possible. (#1394)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
committed by
Zoltan Herczeg
parent
42be0704b9
commit
e8428383f1
@@ -151,14 +151,7 @@ ecma_builtin_object_prototype_object_has_own_property (ecma_value_t this_arg, /*
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
|
||||
|
||||
/* 3. */
|
||||
if (ecma_op_object_has_own_property (obj_p, property_name_string_p))
|
||||
{
|
||||
return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
return_value = ecma_make_boolean_value (ecma_op_object_has_own_property (obj_p, property_name_string_p));
|
||||
|
||||
ECMA_FINALIZE (obj_val);
|
||||
|
||||
|
||||
@@ -330,14 +330,7 @@ ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
|
||||
ecma_builtin_regexp_prototype_exec (this_arg, arg),
|
||||
ret_value);
|
||||
|
||||
if (ecma_is_value_null (match_value))
|
||||
{
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
ret_value = ecma_make_boolean_value (!ecma_is_value_null (match_value));
|
||||
|
||||
ECMA_FINALIZE (match_value);
|
||||
|
||||
|
||||
@@ -228,14 +228,7 @@ opfunc_in (ecma_value_t left_value, /**< left value */
|
||||
ecma_string_t *left_value_prop_name_p = ecma_get_string_from_value (str_left_value);
|
||||
ecma_object_t *right_value_obj_p = ecma_get_object_from_value (right_value);
|
||||
|
||||
if (ecma_op_object_has_property (right_value_obj_p, left_value_prop_name_p))
|
||||
{
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
ret_value = ecma_make_boolean_value (ecma_op_object_has_property (right_value_obj_p, left_value_prop_name_p));
|
||||
|
||||
ECMA_FINALIZE (str_left_value);
|
||||
}
|
||||
|
||||
@@ -79,14 +79,7 @@ vm_var_decl (vm_frame_ctx_t *frame_ctx_p, /**< interpreter context */
|
||||
ecma_value_t
|
||||
opfunc_logical_not (ecma_value_t left_value) /**< left value */
|
||||
{
|
||||
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
|
||||
if (ecma_op_to_boolean (left_value))
|
||||
{
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
return ecma_make_boolean_value (!ecma_op_to_boolean (left_value));
|
||||
} /* opfunc_logical_not */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user