Implement Symbol.matchAll (#4082)

The following methods were implemented:
- String.prototype.matchAll based on ECMA-262 v11, 21.1.3.12
- RegExp.prototype[@@matchAll] based on ECMA-262 v11, 21.2.5.8
- RegExp String Iterator Object based on 21.2.7

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2021-01-18 18:08:35 +01:00
committed by GitHub
parent 1d42d17ab6
commit 6ec4455111
24 changed files with 965 additions and 83 deletions
+20
View File
@@ -813,6 +813,13 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
{
break;
}
case ECMA_PSEUDO_REGEXP_STRING_ITERATOR:
{
ecma_regexp_string_iterator_t *regexp_string_iterator_obj = (ecma_regexp_string_iterator_t *) object_p;
ecma_value_t regexp = regexp_string_iterator_obj->iterating_regexp;
ecma_gc_set_object_visited (ecma_get_object_from_value (regexp));
break;
}
#endif /* ENABLED (JERRY_ESNEXT) */
default:
{
@@ -1728,6 +1735,19 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
break;
}
case ECMA_PSEUDO_REGEXP_STRING_ITERATOR:
{
ecma_regexp_string_iterator_t *regexp_string_iterator_obj = (ecma_regexp_string_iterator_t *) object_p;
ecma_value_t iterated_string = regexp_string_iterator_obj->iterated_string;
if (!ecma_is_value_empty (iterated_string))
{
ecma_deref_ecma_string (ecma_get_string_from_value (iterated_string));
}
ext_object_size = sizeof (ecma_regexp_string_iterator_t);
break;
}
#endif /* ENABLED (JERRY_ESNEXT) */
default:
{