mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
LibJS: Expose the StringToNumber AO for public use
This will be needed outside of Value.cpp.
This commit is contained in:
parent
a33cad1197
commit
e952dca026
2 changed files with 3 additions and 1 deletions
|
@ -524,7 +524,7 @@ static Optional<NumberParseResult> parse_number_text(StringView text)
|
|||
}
|
||||
|
||||
// 7.1.4.1.1 StringToNumber ( str ), https://tc39.es/ecma262/#sec-stringtonumber
|
||||
static Optional<Value> string_to_number(StringView string)
|
||||
Optional<Value> string_to_number(StringView string)
|
||||
{
|
||||
// 1. Let text be StringToCodePoints(str).
|
||||
String text = Utf8View(string).trim(whitespace_characters, AK::TrimMode::Both).as_string();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue