mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 12:06:07 +00:00
LibJS: Implement RegExp legacy static properties
RegExp legacy static properties Spec url is https://github.com/tc39/proposal-regexp-legacy-features
This commit is contained in:
parent
5e2fe7e2bf
commit
0d96468e9b
Notes:
sideshowbarker
2024-07-17 09:49:33 +09:00
Author: https://github.com/leeight
Commit: 0d96468e9b
Pull-request: https://github.com/SerenityOS/serenity/pull/15585
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/davidot
Reviewed-by: https://github.com/linusg
12 changed files with 726 additions and 9 deletions
|
@ -50,6 +50,11 @@ public:
|
|||
String const& flags() const { return m_flags; }
|
||||
Regex<ECMA262> const& regex() { return *m_regex; }
|
||||
Regex<ECMA262> const& regex() const { return *m_regex; }
|
||||
Realm& realm() { return *m_realm; }
|
||||
Realm const& realm() const { return *m_realm; }
|
||||
bool legacy_features_enabled() const { return m_legacy_features_enabled; }
|
||||
void set_legacy_features_enabled(bool legacy_features_enabled) { m_legacy_features_enabled = legacy_features_enabled; }
|
||||
void set_realm(Realm& realm) { m_realm = &realm; }
|
||||
|
||||
private:
|
||||
RegExpObject(Object& prototype);
|
||||
|
@ -57,6 +62,9 @@ private:
|
|||
|
||||
String m_pattern;
|
||||
String m_flags;
|
||||
bool m_legacy_features_enabled { false }; // [[LegacyFeaturesEnabled]]
|
||||
// Note: This is initialized in RegExpAlloc, but will be non-null afterwards
|
||||
GCPtr<Realm> m_realm; // [[Realm]]
|
||||
Optional<Regex<ECMA262>> m_regex;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue