diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index 6ea6e7b4bd8..0926aff902f 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -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> regexp_create(VM& vm, Value pattern, Value flags) { diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.h b/Userland/Libraries/LibJS/Runtime/RegExpObject.h index 2ea9074ceb1..cb49cd37b5f 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.h @@ -60,6 +60,8 @@ private: RegExpObject(Object& prototype); RegExpObject(Regex 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]]