mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
LibJS: Convert the RegExpCreate AO to ThrowCompletionOr
This commit is contained in:
parent
d9f5e2d461
commit
844be7a0a5
5 changed files with 11 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue