mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-17 16:28:06 +03:00
LibJS: Trim non-ASCII whitespace as well in StringToNumber
This regressed in f4b3bb5
.
This commit is contained in:
parent
f4b3bb519f
commit
c88c33dc22
Notes:
sideshowbarker
2024-07-17 07:38:10 +09:00
@ -527,7 +527,7 @@ static Optional<NumberParseResult> parse_number_text(StringView text)
|
||||
static Optional<Value> string_to_number(StringView string)
|
||||
{
|
||||
// 1. Let text be StringToCodePoints(str).
|
||||
String text = string.trim_whitespace();
|
||||
String text = Utf8View(string).trim(whitespace_characters, AK::TrimMode::Both).as_string();
|
||||
|
||||
// 2. Let literal be ParseText(text, StringNumericLiteral).
|
||||
if (text.is_empty())
|
||||
|
Loading…
Reference in New Issue
Block a user