mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
LibJS: Handle Infinity in Value::to_number()
This commit is contained in:
parent
477bacddad
commit
f226746394
Notes:
sideshowbarker
2024-07-19 07:41:11 +09:00
Author: https://github.com/linusg
Commit: f226746394
Pull-request: https://github.com/SerenityOS/serenity/pull/1757
3 changed files with 17 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue