Support parsing async modifiers for functions. (#3460)

Only parsing is implemented, so the async functions currently behave
like normal function except they return with a resolved Promise object
when the function is terminated correctly.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-12-20 09:55:41 +01:00
committed by GitHub
parent 2a29b72a83
commit 8cb2be6001
22 changed files with 873 additions and 234 deletions
+12
View File
@@ -670,6 +670,18 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
}
}
#if ENABLED (JERRY_ES2015)
if (literal_pool_p->status_flags & SCANNER_LITERAL_POOL_ASYNC)
{
status_flags |= SCANNER_FUNCTION_ASYNC;
if (literal_pool_p->status_flags & SCANNER_LITERAL_POOL_FUNCTION_STATEMENT)
{
status_flags |= SCANNER_FUNCTION_STATEMENT;
}
}
#endif /* ENABLED (JERRY_ES2015) */
info_p->u8_arg = status_flags;
info_p->u16_arg = (uint16_t) no_declarations;
}