LibWeb: Add missing visit_edges implementation to RegExpObject

This commit is contained in:
Idan Horowitz 2024-04-05 20:41:25 +03:00 committed by Andreas Kling
parent f357998e81
commit b018114bee
Notes: sideshowbarker 2024-07-17 06:45:52 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -304,6 +304,12 @@ ByteString RegExpObject::escape_regexp_pattern() const
return builder.to_byte_string();
}
void RegExpObject::visit_edges(JS::Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_realm);
}
// 22.2.3.1 RegExpCreate ( P, F ), https://tc39.es/ecma262/#sec-regexpcreate
ThrowCompletionOr<NonnullGCPtr<RegExpObject>> regexp_create(VM& vm, Value pattern, Value flags)
{

View file

@ -60,6 +60,8 @@ private:
RegExpObject(Object& prototype);
RegExpObject(Regex<ECMA262> regex, ByteString pattern, ByteString flags, Object& prototype);
virtual void visit_edges(Visitor&) override;
ByteString m_pattern;
ByteString m_flags;
bool m_legacy_features_enabled { false }; // [[LegacyFeaturesEnabled]]