From 844be7a0a5f6b8708970b2eaf2acf2edb02561a9 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 23 Oct 2021 03:52:23 +0300 Subject: LibJS: Convert the RegExpCreate AO to ThrowCompletionOr --- Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp') 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 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 -- cgit v1.2.3