blob: 0de64012b46f9c8b1982a2a16f5f0cb9a9903ada (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
load("test-common.js");
try {
assert(Number.isNaN.length === 1);
assert(Number.isNaN(0) === false);
assert(Number.isNaN(42) === false);
assert(Number.isNaN("") === false);
assert(Number.isNaN("0") === false);
assert(Number.isNaN("42") === false);
assert(Number.isNaN(true) === false);
assert(Number.isNaN(false) === false);
assert(Number.isNaN(null) === false);
assert(Number.isNaN([]) === false);
assert(Number.isNaN(Infinity) === false);
assert(Number.isNaN(-Infinity) === false);
assert(Number.isNaN() === false);
assert(Number.isNaN(undefined) === false);
assert(Number.isNaN("foo") === false);
assert(Number.isNaN({}) === false);
assert(Number.isNaN([1, 2, 3]) === false);
assert(Number.isNaN(NaN) === true);
assert(Number.isNaN(Number.NaN) === true);
assert(Number.isNaN(0 / 0) === true);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e.message);
}
|