Fix the internal object reference count in Map/Set.prototype.forEach (#3081)

This patch fixes #3079.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-09-09 10:36:33 +02:00
committed by GitHub
parent 115ad9a41c
commit 3111d0e0f2
2 changed files with 26 additions and 0 deletions
@@ -463,6 +463,8 @@ ecma_op_container_foreach (ecma_value_t this_arg, /**< this argument */
ecma_value_t ret_value = ECMA_VALUE_UNDEFINED;
ecma_ref_object (internal_obj_p);
while (ecma_value_p != NULL)
{
ecma_string_t *prop_name_p = ecma_get_prop_name_from_value (*ecma_value_p);
@@ -516,6 +518,7 @@ ecma_op_container_foreach (ecma_value_t this_arg, /**< this argument */
ecma_value_p = ecma_collection_iterator_next (ecma_value_p);
}
ecma_deref_object (internal_obj_p);
ecma_free_values_collection (props_p, 0);
return ret_value;