LibJS: Add ScopeNode accessors for declaration counts

This commit is contained in:
Andreas Kling 2021-10-08 02:22:02 +02:00
parent 7de2a84cd4
commit c27f91142d
Notes: sideshowbarker 2024-07-18 02:55:58 +09:00

View file

@ -190,6 +190,9 @@ public:
[[nodiscard]] bool has_lexical_declarations() const { return !m_lexical_declarations.is_empty(); }
[[nodiscard]] bool has_var_declarations() const { return !m_var_declarations.is_empty(); }
[[nodiscard]] size_t var_declaration_count() const { return m_var_declarations.size(); }
[[nodiscard]] size_t lexical_declaration_count() const { return m_lexical_declarations.size(); }
void for_each_lexically_scoped_declaration(IteratorOrVoidFunction<Declaration const&>&& callback) const;
void for_each_lexically_declared_name(IteratorOrVoidFunction<FlyString const&>&& callback) const;