Reduce ecma_builtin_helper_def_prop arguments (#2585)

This patch uses the ECMA_PROPERTY_CONFIGURABLE[_ENUMERABLE_[WRITABLE]] marco to pass the options instead of using 3 boolean arguments for it.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2018-11-06 18:13:38 +01:00
committed by Robert Sipka
parent 74d474248d
commit 3faec79071
9 changed files with 41 additions and 83 deletions
@@ -121,9 +121,7 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
ecma_builtin_helper_def_prop (object_p,
item_name_string_p,
array_items_p[index],
true, /* Writable */
true, /* Enumerable */
true, /* Configurable */
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
false); /* Failure handling */
ecma_deref_ecma_string (item_name_string_p);
+2 -3
View File
@@ -157,9 +157,8 @@ ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environme
completion = ecma_builtin_helper_def_prop (binding_obj_p,
name_p,
ECMA_VALUE_UNDEFINED,
true, /* Writable */
true, /* Enumerable */
is_deletable, /* Configurable */
is_deletable ? ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE
: ECMA_PROPERTY_ENUMERABLE_WRITABLE,
true); /* Failure handling */
if (ECMA_IS_VALUE_ERROR (completion))
+2 -4
View File
@@ -947,10 +947,8 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */
return ecma_builtin_helper_def_prop (object_p,
property_name_p,
value,
true, /* Writable */
true, /* Enumerable */
true, /* Configurable */
is_throw); /* Failure handling */
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
true); /* Failure handling */
}
}
@@ -1159,18 +1159,14 @@ re_set_result_array_properties (ecma_object_t *array_obj_p, /**< result array */
ecma_builtin_helper_def_prop (array_obj_p,
ecma_get_magic_string (LIT_MAGIC_STRING_INDEX),
ecma_make_int32_value (index),
true, /* Writable */
true, /* Enumerable */
true, /* Configurable */
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
true); /* Failure handling */
/* Set input property of the result array */
ecma_builtin_helper_def_prop (array_obj_p,
ecma_get_magic_string (LIT_MAGIC_STRING_INPUT),
ecma_make_string_value (input_str_p),
true, /* Writable */
true, /* Enumerable */
true, /* Configurable */
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
true); /* Failure handling */
/* Set length property of the result array */