1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

LibJS: Add support for await expressions

This commit is contained in:
Idan Horowitz 2021-11-09 22:52:21 +02:00 committed by Linus Groh
parent 681787de76
commit 46dabf02ec
7 changed files with 169 additions and 4 deletions

View file

@ -565,6 +565,21 @@ private:
bool m_is_yield_from { false };
};
class AwaitExpression final : public Expression {
public:
explicit AwaitExpression(SourceRange source_range, NonnullRefPtr<Expression> argument)
: Expression(source_range)
, m_argument(move(argument))
{
}
virtual Value execute(Interpreter&, GlobalObject&) const override;
virtual void dump(int indent) const override;
private:
NonnullRefPtr<Expression> m_argument;
};
class ReturnStatement final : public Statement {
public:
explicit ReturnStatement(SourceRange source_range, RefPtr<Expression> argument)