mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Simplify NaN checks in tests.
This commit is contained in:
@@ -885,7 +885,7 @@
|
|||||||
unwrapped = wrapped.value();
|
unwrapped = wrapped.value();
|
||||||
|
|
||||||
return wrapped instanceof _ &&
|
return wrapped instanceof _ &&
|
||||||
(unwrapped === value || (_.isNaN(unwrapped) && _.isNaN(value)));
|
(unwrapped === value || (unwrapped !== unwrapped && value !== value));
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.deepEqual(actual, expected);
|
assert.deepEqual(actual, expected);
|
||||||
@@ -2774,7 +2774,7 @@
|
|||||||
var constant = index ? _.constant(value) : _.constant(),
|
var constant = index ? _.constant(value) : _.constant(),
|
||||||
result = constant();
|
result = constant();
|
||||||
|
|
||||||
return result === value || (_.isNaN(result) && _.isNaN(value));
|
return result === value || (result !== result && value !== value);
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.deepEqual(actual, expected);
|
assert.deepEqual(actual, expected);
|
||||||
|
|||||||
Reference in New Issue
Block a user