LibJS: Treat concise methods as non-constructors

This commit is contained in:
Ollie Hensman-Crook
2026-03-07 12:51:11 +00:00
committed by Andreas Kling
parent 1179e40d3f
commit df8ead1f12
Notes: github-actions[bot] 2026-03-20 21:00:10 +00:00
6 changed files with 321 additions and 2 deletions

View File

@@ -96,7 +96,7 @@ public:
bool has_simple_parameter_list() const { return shared_data().m_has_simple_parameter_list; }
// Equivalent to absence of [[Construct]]
virtual bool has_constructor() const override { return kind() == FunctionKind::Normal && !shared_data().m_is_arrow_function; }
virtual bool has_constructor() const override { return kind() == FunctionKind::Normal && !shared_data().m_is_arrow_function && !m_is_method; }
virtual Vector<LocalVariable> const& local_variables_names() const override { return shared_data().m_local_variables_names; }
@@ -151,6 +151,7 @@ private:
mutable OwnPtr<ClassData> m_class_data;
mutable bool m_may_need_lazy_prototype_instantiation { false };
bool m_is_method { false };
};
template<>