mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibJS: Basic NaN support
This patch adds js_nan() for constructing a NaN value. You can check if a Value is NaN with Value::is_nan().
This commit is contained in:
parent
23c5323a70
commit
9a78b4af2c
3 changed files with 23 additions and 7 deletions
9
Libraries/LibJS/Tests/NaN-basic.js
Normal file
9
Libraries/LibJS/Tests/NaN-basic.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
function assert(x) { if (!x) throw 1; }
|
||||
|
||||
try {
|
||||
var nan = undefined + 1;
|
||||
assert(nan + "" == "NaN");
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue