mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibJS: Return OptionalNone in fallible functions in the Intl namespace
This commit is contained in:
parent
5349972f41
commit
be8907e6bb
2 changed files with 6 additions and 5 deletions
|
@ -32,7 +32,7 @@ static ThrowCompletionOr<Optional<String>> get_string_option(VM& vm, Object cons
|
|||
{
|
||||
auto option = TRY(get_option(vm, options, property, OptionType::String, values, Empty {}));
|
||||
if (option.is_undefined())
|
||||
return Optional<String> {};
|
||||
return OptionalNone {};
|
||||
|
||||
if (validator && !validator(TRY(option.as_string().utf8_string_view())))
|
||||
return vm.throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, option, property);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue