Simplify NaN checks in tests.

This commit is contained in:
John-David Dalton
2015-11-08 12:13:37 -08:00
parent f6d81e1bd8
commit 73d68c9609

View File

@@ -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);