1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:17:46 +00:00

LibJS: Add Number.parseFloat()

This commit is contained in:
Linus Groh 2020-05-17 15:12:50 +01:00 committed by Andreas Kling
parent 6f6b089aa0
commit 73eef31f49
4 changed files with 14 additions and 1 deletions

View file

@ -1,6 +1,7 @@
load("test-common.js");
try {
assert(Number.isFinite !== isFinite);
assert(Number.isFinite.length === 1);
assert(Number.isFinite(0) === true);

View file

@ -1,6 +1,7 @@
load("test-common.js");
try {
assert(Number.isNaN !== isNaN);
assert(Number.isNaN.length === 1);
assert(Number.isNaN(0) === false);

View file

@ -0,0 +1,11 @@
load("test-common.js");
try {
// Ensuring it's the same function as the global
// parseFloat() is enough as that already has tests :^)
assert(Number.parseFloat === parseFloat);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}