diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-23 03:52:23 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-23 18:01:51 +0200 |
commit | 844be7a0a5f6b8708970b2eaf2acf2edb02561a9 (patch) | |
tree | c8a12dbc20dd3bad935cce9ff6c7a1ecbd941133 /Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp | |
parent | d9f5e2d461b5559695bef56c14b063ac2b152fa1 (diff) | |
download | serenity-844be7a0a5f6b8708970b2eaf2acf2edb02561a9.zip |
LibJS: Convert the RegExpCreate AO to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp index cf5de31032..5869283b59 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp @@ -88,10 +88,7 @@ ThrowCompletionOr<Object*> RegExpConstructor::construct(FunctionObject&) flags_value = flags; } - auto* regexp = regexp_create(global_object, pattern_value, flags_value); - if (auto* exception = vm.exception()) - return throw_completion(exception->value()); - return regexp; + return TRY(regexp_create(global_object, pattern_value, flags_value)); } // 22.2.4.2 get RegExp [ @@species ], https://tc39.es/ecma262/#sec-get-regexp-@@species |