diff options
author | Linus Groh <mail@linusgroh.de> | 2022-10-16 14:57:29 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-16 17:32:02 +0200 |
commit | 1da66b5879294bd163157be7fbe347fd63c9ea1e (patch) | |
tree | e460e63031cdad905e769edc4e8a019e917efd3e /Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp | |
parent | db31c22491e6ec6ae374b9bd642dc21db8ff79a7 (diff) | |
download | serenity-1da66b5879294bd163157be7fbe347fd63c9ea1e.zip |
LibJS: Implement the RegExpAlloc AO
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp index 7f6daaeae6..1e57e4897d 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp @@ -82,7 +82,9 @@ ThrowCompletionOr<Object*> RegExpConstructor::construct(FunctionObject&) flags_value = flags; } - return TRY(regexp_create(vm, pattern_value, flags_value)); + auto regexp_object = TRY(regexp_alloc(vm, new_target)); + + return TRY(regexp_object->regexp_initialize(vm, pattern_value, flags_value)).ptr(); } // 22.2.4.2 get RegExp [ @@species ], https://tc39.es/ecma262/#sec-get-regexp-@@species |