From aae02af2650d197fff15519a438f16ae994bb449 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 14 Feb 2016 19:20:17 -0800 Subject: [PATCH] Cleanup `Date` shims. --- test/test.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test.js b/test/test.js index 9111a91ad..4b79aa526 100644 --- a/test/test.js +++ b/test/test.js @@ -8860,9 +8860,11 @@ QUnit.test('should compare date objects', function(assert) { assert.expect(4); - assert.strictEqual(_.isEqual(new Date(2012, 4, 23), new Date(2012, 4, 23)), true); - assert.strictEqual(_.isEqual(new Date(2012, 4, 23), new Date(2013, 3, 25)), false); - assert.strictEqual(_.isEqual(new Date(2012, 4, 23), { 'getTime': lodashStable.constant(1337756400000) }), false); + var date = new Date(2012, 4, 23); + + assert.strictEqual(_.isEqual(date, new Date(2012, 4, 23)), 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); }); @@ -20710,7 +20712,9 @@ dateCount = 0; var getTime = function() { - return ++dateCount == 5 ? Infinity : +new Date; + return ++dateCount == 5 + ? Infinity + : +new Date; }; var lodash = _.runInContext(lodashStable.assign({}, root, { @@ -21000,7 +21004,9 @@ dateCount = 0; var getTime = function() { - return ++dateCount === 4 ? +new Date(2012, 3, 23, 23, 27, 18) : +new Date; + return ++dateCount === 4 + ? +new Date(2012, 3, 23, 23, 27, 18) + : +new Date; }; var lodash = _.runInContext(lodashStable.assign({}, root, {