mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
LibJS: Add using declaration support in for and for of loops
The using declarations have kind of special behavior in for loops so this is seperated.
This commit is contained in:
parent
541637e15a
commit
bff038411a
6 changed files with 447 additions and 77 deletions
|
@ -922,6 +922,8 @@ public:
|
|||
virtual Bytecode::CodeGenerationErrorOr<void> generate_labelled_evaluation(Bytecode::Generator&, Vector<DeprecatedFlyString> const&) const override;
|
||||
|
||||
private:
|
||||
Completion for_body_evaluation(Interpreter&, Vector<DeprecatedFlyString> const&, size_t per_iteration_bindings_size) const;
|
||||
|
||||
RefPtr<ASTNode> m_init;
|
||||
RefPtr<Expression> m_test;
|
||||
RefPtr<Expression> m_update;
|
||||
|
@ -1736,6 +1738,8 @@ public:
|
|||
|
||||
virtual bool is_lexical_declaration() const override { return true; }
|
||||
|
||||
NonnullRefPtrVector<VariableDeclarator> const& declarations() const { return m_declarations; }
|
||||
|
||||
private:
|
||||
NonnullRefPtrVector<VariableDeclarator> m_declarations;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue