mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
LibJS: Make PrimitiveString::utf8_string() infallible
Work towards #20449.
This commit is contained in:
parent
7849950383
commit
c084269e5f
29 changed files with 79 additions and 93 deletions
|
@ -33,10 +33,10 @@ static ThrowCompletionOr<Optional<String>> get_string_option(VM& vm, Object cons
|
|||
if (option.is_undefined())
|
||||
return OptionalNone {};
|
||||
|
||||
if (validator && !validator(TRY(option.as_string().utf8_string_view())))
|
||||
if (validator && !validator(option.as_string().utf8_string_view()))
|
||||
return vm.throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, option, property);
|
||||
|
||||
return TRY(option.as_string().utf8_string());
|
||||
return option.as_string().utf8_string();
|
||||
}
|
||||
|
||||
// 14.1.2 ApplyOptionsToTag ( tag, options ), https://tc39.es/ecma402/#sec-apply-options-to-tag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue