mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
AK: Make String::number() infallible
This API will always succeed in creating a String representing the provided number in base-10.
This commit is contained in:
parent
03569fc509
commit
dd419b5a8d
Notes:
github-actions[bot]
2024-10-14 18:49:07 +00:00
Author: https://github.com/awesomekling
Commit: dd419b5a8d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1796
46 changed files with 77 additions and 81 deletions
|
@ -1866,7 +1866,7 @@ unsigned HTMLInputElement::size() const
|
|||
|
||||
WebIDL::ExceptionOr<void> HTMLInputElement::set_size(unsigned value)
|
||||
{
|
||||
return set_attribute(HTML::AttributeNames::size, MUST(String::number(value)));
|
||||
return set_attribute(HTML::AttributeNames::size, String::number(value));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#concept-input-value-string-number
|
||||
|
@ -1889,11 +1889,11 @@ String HTMLInputElement::convert_number_to_string(double input) const
|
|||
{
|
||||
// https://html.spec.whatwg.org/multipage/input.html#number-state-(type=number):concept-input-value-number-string
|
||||
if (type_state() == TypeAttributeState::Number)
|
||||
return MUST(String::number(input));
|
||||
return String::number(input);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#range-state-(type=range):concept-input-value-number-string
|
||||
if (type_state() == TypeAttributeState::Range)
|
||||
return MUST(String::number(input));
|
||||
return String::number(input);
|
||||
|
||||
dbgln("HTMLInputElement::convert_number_to_string() not implemented for input type {}", type());
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue