mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
LibJS: Make PluralRules use the new double parser
This commit is contained in:
parent
7db59124e8
commit
d66bfcc3f4
Notes:
sideshowbarker
2024-07-17 05:11:48 +09:00
Author: https://github.com/davidot
Commit: d66bfcc3f4
Pull-request: https://github.com/SerenityOS/serenity/pull/15377
Issue: https://github.com/SerenityOS/serenity/issues/14691
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/linusg
1 changed files with 1 additions and 3 deletions
|
@ -21,9 +21,7 @@ PluralRules::PluralRules(Object& prototype)
|
|||
::Locale::PluralOperands get_operands(String const& string)
|
||||
{
|
||||
// 1.Let n be ! ToNumber(s).
|
||||
char* end { nullptr };
|
||||
auto number = strtod(string.characters(), &end);
|
||||
VERIFY(!*end);
|
||||
auto number = string.to_double(AK::TrimWhitespace::Yes).release_value();
|
||||
|
||||
// 2. Assert: n is finite.
|
||||
VERIFY(isfinite(number));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue