mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:27:45 +00:00
LibJS: Make PluralRules use the new double parser
This commit is contained in:
parent
7db59124e8
commit
d66bfcc3f4
1 changed files with 1 additions and 3 deletions
|
@ -21,9 +21,7 @@ PluralRules::PluralRules(Object& prototype)
|
||||||
::Locale::PluralOperands get_operands(String const& string)
|
::Locale::PluralOperands get_operands(String const& string)
|
||||||
{
|
{
|
||||||
// 1.Let n be ! ToNumber(s).
|
// 1.Let n be ! ToNumber(s).
|
||||||
char* end { nullptr };
|
auto number = string.to_double(AK::TrimWhitespace::Yes).release_value();
|
||||||
auto number = strtod(string.characters(), &end);
|
|
||||||
VERIFY(!*end);
|
|
||||||
|
|
||||||
// 2. Assert: n is finite.
|
// 2. Assert: n is finite.
|
||||||
VERIFY(isfinite(number));
|
VERIFY(isfinite(number));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue