mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Make _.isEqual treat invalid dates as equiv.
This commit is contained in:
@@ -9777,9 +9777,10 @@
|
||||
var date = new Date(2012, 4, 23);
|
||||
|
||||
assert.strictEqual(_.isEqual(date, new Date(2012, 4, 23)), true);
|
||||
assert.strictEqual(_.isEqual(new Date('a'), new Date('b')), true);
|
||||
|
||||
assert.strictEqual(_.isEqual(date, new Date(2013, 3, 25)), false);
|
||||
assert.strictEqual(_.isEqual(date, { 'getTime': lodashStable.constant(+date) }), false);
|
||||
assert.strictEqual(_.isEqual(new Date('a'), new Date('a')), false);
|
||||
});
|
||||
|
||||
QUnit.test('should compare error objects', function(assert) {
|
||||
|
||||
@@ -285,6 +285,7 @@
|
||||
'Commutative equality is implemented for `0` and `-0`',
|
||||
'`new Number(0)` and `-0` are not equal',
|
||||
'Commutative equality is implemented for `new Number(0)` and `-0`',
|
||||
'Invalid dates are not equal',
|
||||
'false'
|
||||
],
|
||||
'isFinite': [
|
||||
|
||||
Reference in New Issue
Block a user