diff options
author | Linus Groh <mail@linusgroh.de> | 2020-04-12 13:06:34 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-12 14:39:38 +0200 |
commit | f22674639430d1ec515501fabc57b0b0681cc933 (patch) | |
tree | 2ecdde8b63b1691abafad9985ce76a2c2b4382e7 /Libraries/LibJS/Tests/to-number-basic.js | |
parent | 477bacddadd1b8600b55830e307aebd433d77db9 (diff) | |
download | serenity-f22674639430d1ec515501fabc57b0b0681cc933.zip |
LibJS: Handle Infinity in Value::to_number()
Diffstat (limited to 'Libraries/LibJS/Tests/to-number-basic.js')
-rw-r--r-- | Libraries/LibJS/Tests/to-number-basic.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/to-number-basic.js b/Libraries/LibJS/Tests/to-number-basic.js index afde29785f..cf41bb8b3c 100644 --- a/Libraries/LibJS/Tests/to-number-basic.js +++ b/Libraries/LibJS/Tests/to-number-basic.js @@ -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)); |