1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:25:08 +00:00
serenity/Libraries/LibJS/Tests/NaN-basic.js
Andreas Kling 9a78b4af2c 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().
2020-03-27 12:40:22 +01:00

9 lines
179 B
JavaScript

function assert(x) { if (!x) throw 1; }
try {
var nan = undefined + 1;
assert(nan + "" == "NaN");
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}