Implement async function execution. (#3897)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-06-17 12:08:01 +02:00
committed by GitHub
parent eb8e81d682
commit 8719f72e61
18 changed files with 663 additions and 173 deletions
+1 -9
View File
@@ -3017,7 +3017,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
#if ENABLED (JERRY_ESNEXT)
if (context_p->status_flags & PARSER_IS_ASYNC_FUNCTION)
{
parser_emit_cbc_ext (context_p, CBC_EXT_RETURN_PROMISE_UNDEFINED);
parser_emit_cbc_ext (context_p, CBC_EXT_RETURN_UNDEFINED);
break;
}
#endif /* ENABLED (JERRY_ESNEXT) */
@@ -3028,14 +3028,6 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
parser_parse_expression (context_p, PARSE_EXPR);
#if ENABLED (JERRY_ESNEXT)
if (context_p->status_flags & PARSER_IS_ASYNC_FUNCTION)
{
parser_emit_cbc_ext (context_p, CBC_EXT_RETURN_PROMISE);
break;
}
#endif /* ENABLED (JERRY_ESNEXT) */
if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
{
context_p->last_cbc_opcode = CBC_RETURN_WITH_LITERAL;