mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +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
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