From d66bfcc3f4dd13f6ebb91c15b65e5abee75ead87 Mon Sep 17 00:00:00 2001 From: davidot Date: Wed, 12 Oct 2022 02:23:09 +0200 Subject: [PATCH] LibJS: Make PluralRules use the new double parser --- Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp index 8a75304484..2f339bc2f5 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp @@ -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));