1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

LibJS: Implement the RegExpAlloc AO

This commit is contained in:
Linus Groh 2022-10-16 14:57:29 +02:00
parent db31c22491
commit 1da66b5879
4 changed files with 28 additions and 10 deletions

View file

@ -14,7 +14,8 @@
namespace JS {
ThrowCompletionOr<RegExpObject*> regexp_create(VM&, Value pattern, Value flags);
ThrowCompletionOr<NonnullGCPtr<RegExpObject>> regexp_create(VM&, Value pattern, Value flags);
ThrowCompletionOr<NonnullGCPtr<RegExpObject>> regexp_alloc(VM&, FunctionObject& new_target);
Result<regex::RegexOptions<ECMAScriptFlags>, String> regex_flags_from_string(StringView flags);
struct ParseRegexPatternError {
@ -39,7 +40,7 @@ public:
static RegExpObject* create(Realm&);
static RegExpObject* create(Realm&, Regex<ECMA262> regex, String pattern, String flags);
ThrowCompletionOr<RegExpObject*> regexp_initialize(VM&, Value pattern, Value flags);
ThrowCompletionOr<NonnullGCPtr<RegExpObject>> regexp_initialize(VM&, Value pattern, Value flags);
String escape_regexp_pattern() const;
virtual void initialize(Realm&) override;