mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Make parseFloat use the new double parser
This means it no longer is locale dependent and doesn't incorrectly accept hex floats anymore.
This commit is contained in:
parent
29a96b1304
commit
62fc3e50f3
Notes:
sideshowbarker
2024-07-17 11:06:06 +09:00
Author: https://github.com/davidot
Commit: 62fc3e50f3
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
2 changed files with 19 additions and 4 deletions
|
@ -22,6 +22,9 @@ test("parsing strings", () => {
|
|||
["1.23", 1.23],
|
||||
["0.0123E+2", 1.23],
|
||||
["1.23e4", 12300],
|
||||
["0x1.23p5", 0],
|
||||
["1.23p5", 1.23],
|
||||
["1.23e42351245", Infinity],
|
||||
["Infinity", Infinity],
|
||||
].forEach(test => {
|
||||
expect(parseFloat(test[0])).toBe(test[1]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue