Add builtin GeneratorFunction support (#3499)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-01-15 12:01:58 +01:00
committed by GitHub
parent e3decffdd3
commit 4a331b2edc
24 changed files with 659 additions and 152 deletions
+14 -1
View File
@@ -1915,7 +1915,20 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
error_location_p->error = PARSER_ERR_NO_ERROR;
}
context.status_flags = (arg_list_p == NULL) ? 0 : PARSER_IS_FUNCTION;
if (arg_list_p == NULL)
{
context.status_flags = 0;
}
else
{
context.status_flags = PARSER_IS_FUNCTION;
#if ENABLED (JERRY_ES2015)
if (parse_opts & ECMA_PARSE_GENERATOR_FUNCTION)
{
context.status_flags |= PARSER_IS_GENERATOR_FUNCTION;
}
#endif /* ENABLED (JERRY_ES2015) */
}
#if ENABLED (JERRY_ES2015)
context.status_flags |= PARSER_GET_CLASS_PARSER_OPTS (parse_opts);
-1
View File
@@ -3071,7 +3071,6 @@ scan_completed:
#if ENABLED (JERRY_ES2015)
JERRY_ASSERT (scanner_context.active_binding_list_p == NULL);
JERRY_ASSERT (!(context_p->status_flags & PARSER_IS_GENERATOR_FUNCTION));
#endif /* ENABLED (JERRY_ES2015) */
JERRY_ASSERT (scanner_context.active_literal_pool_p == NULL);