forked from zloirock/core-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathes.number.is-nan.js
More file actions
35 lines (34 loc) · 768 Bytes
/
Copy pathes.number.is-nan.js
File metadata and controls
35 lines (34 loc) · 768 Bytes
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
31
32
33
34
35
import create from 'core-js-pure/es/object/create';
import isNaN from 'core-js-pure/es/number/is-nan';
QUnit.test('Number.isNaN', assert => {
assert.isFunction(isNaN);
assert.true(isNaN(NaN), 'Number.isNaN NaN');
const notNaNs = [
1,
0.1,
-1,
2 ** 16,
2 ** 16 - 1,
2 ** 31,
2 ** 31 - 1,
2 ** 32,
2 ** 32 - 1,
-0,
Infinity,
'NaN',
'5',
false,
new Number(NaN),
new Number(Infinity),
new Number(5),
new Number(0.1),
undefined,
null,
{},
function () { /* empty */ },
];
for (const value of notNaNs) {
assert.false(isNaN(value), `not Number.isNaN ${ typeof value } ${ value }`);
}
assert.false(isNaN(create(null)), 'Number.isNaN(Object.create(null)) -> false');
});