1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibJS: Convert the RegExpCreate AO to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-23 03:52:23 +03:00 committed by Andreas Kling
parent d9f5e2d461
commit 844be7a0a5
5 changed files with 11 additions and 17 deletions

View file

@ -190,10 +190,10 @@ String RegExpObject::escape_regexp_pattern() const
}
// 22.2.3.2.4 RegExpCreate ( P, F ), https://tc39.es/ecma262/#sec-regexpcreate
RegExpObject* regexp_create(GlobalObject& global_object, Value pattern, Value flags)
ThrowCompletionOr<RegExpObject*> regexp_create(GlobalObject& global_object, Value pattern, Value flags)
{
auto* regexp_object = RegExpObject::create(global_object);
return TRY_OR_DISCARD(regexp_object->regexp_initialize(global_object, pattern, flags));
return TRY(regexp_object->regexp_initialize(global_object, pattern, flags));
}
}