mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
LibJS: Implement parsing and executing for-await-of loops
This commit is contained in:
parent
b3699029e2
commit
e69276e704
5 changed files with 242 additions and 7 deletions
|
@ -753,6 +753,25 @@ private:
|
|||
NonnullRefPtr<Statement> m_body;
|
||||
};
|
||||
|
||||
class ForAwaitOfStatement final : public IterationStatement {
|
||||
public:
|
||||
ForAwaitOfStatement(SourceRange source_range, Variant<NonnullRefPtr<ASTNode>, NonnullRefPtr<BindingPattern>> lhs, NonnullRefPtr<Expression> rhs, NonnullRefPtr<Statement> body)
|
||||
: IterationStatement(source_range)
|
||||
, m_lhs(move(lhs))
|
||||
, m_rhs(move(rhs))
|
||||
, m_body(move(body))
|
||||
{
|
||||
}
|
||||
|
||||
virtual Value execute(Interpreter&, GlobalObject&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
private:
|
||||
Variant<NonnullRefPtr<ASTNode>, NonnullRefPtr<BindingPattern>> m_lhs;
|
||||
NonnullRefPtr<Expression> m_rhs;
|
||||
NonnullRefPtr<Statement> m_body;
|
||||
};
|
||||
|
||||
enum class BinaryOp {
|
||||
Addition,
|
||||
Subtraction,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue