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:
parent
681787de76
commit
46dabf02ec
7 changed files with 169 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue