1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 10:22:13 +00:00

LibJS: Handle Infinity in Value::to_number()

This commit is contained in:
Linus Groh 2020-04-12 13:06:34 +01:00 committed by Andreas Kling
parent 477bacddad
commit f226746394
3 changed files with 17 additions and 0 deletions

View file

@ -22,6 +22,12 @@ try {
// FIXME: returns NaN
// assert(+"1.23" === 1.23)
// assert(-"1.23" === -1.23)
assert(+"Infinity" === Infinity);
assert(+"+Infinity" === Infinity);
assert(+"-Infinity" === -Infinity);
assert(-"Infinity" === -Infinity);
assert(-"+Infinity" === -Infinity);
assert(-"-Infinity" === Infinity);
assert(isNaN(+undefined));
assert(isNaN(-undefined));