summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-10-16 14:57:29 +0200
committerLinus Groh <mail@linusgroh.de>2022-10-16 17:32:02 +0200
commit1da66b5879294bd163157be7fbe347fd63c9ea1e (patch)
treee460e63031cdad905e769edc4e8a019e917efd3e /Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp
parentdb31c22491e6ec6ae374b9bd642dc21db8ff79a7 (diff)
downloadserenity-1da66b5879294bd163157be7fbe347fd63c9ea1e.zip
LibJS: Implement the RegExpAlloc AO
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp4
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