1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibJS: Add support for async functions

This commit adds support for the most bare bones version of async
functions, support for async generator functions, async arrow functions
and await expressions are TODO.
This commit is contained in:
Idan Horowitz 2021-11-09 20:39:22 +02:00 committed by Linus Groh
parent 05c3320da3
commit 681787de76
17 changed files with 399 additions and 36 deletions

View file

@ -1921,7 +1921,7 @@ void BindingPattern::dump(int indent) const
void FunctionNode::dump(int indent, String const& class_name) const
{
print_indent(indent);
outln("{}{} '{}'", class_name, m_kind == FunctionKind::Generator ? "*" : "", name());
outln("{}{}{} '{}'", class_name, m_kind == FunctionKind::Async ? " async" : "", m_kind == FunctionKind::Generator ? "*" : "", name());
if (m_contains_direct_call_to_eval) {
print_indent(indent + 1);
outln("\033[31;1m(direct eval)\033[0m");