summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests
diff options
context:
space:
mode:
authordavidot <davidot@serenityos.org>2022-10-12 02:12:13 +0200
committerLinus Groh <mail@linusgroh.de>2022-10-23 15:48:45 +0200
commit62fc3e50f397ea59c4329b29c4777ac60d46e490 (patch)
tree58b09a355e90233aee5c35d1eaf2cc1e11105b43 /Userland/Libraries/LibJS/Tests
parent29a96b13041353eafefdc57a1934e54f27e27d94 (diff)
downloadserenity-62fc3e50f397ea59c4329b29c4777ac60d46e490.zip
LibJS: Make parseFloat use the new double parser
This means it no longer is locale dependent and doesn't incorrectly accept hex floats anymore.
Diffstat (limited to 'Userland/Libraries/LibJS/Tests')
-rw-r--r--Userland/Libraries/LibJS/Tests/builtins/functions/parseFloat.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/functions/parseFloat.js b/Userland/Libraries/LibJS/Tests/builtins/functions/parseFloat.js
index 20ed2633dd..5f62ec01a4 100644
--- a/Userland/Libraries/LibJS/Tests/builtins/functions/parseFloat.js
+++ b/Userland/Libraries/LibJS/Tests/builtins/functions/parseFloat.js
@@ -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]);