From 6bcbb6f7bbae7547139f18d5b974ce3036c40357 Mon Sep 17 00:00:00 2001 From: jdalton Date: Tue, 26 May 2015 11:39:29 -0700 Subject: [PATCH] Simplify `_.now` and `_.isFinite`. --- lodash.src.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index b45bcfc67..cec9e8829 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -765,8 +765,6 @@ nativeKeys = getNative(Object, 'keys'), nativeMax = Math.max, nativeMin = Math.min, - nativeNow = getNative(Date, 'now'), - nativeNumIsFinite = getNative(Number, 'isFinite'), nativeParseInt = context.parseInt, nativeRandom = Math.random; @@ -7293,9 +7291,9 @@ * }, _.now()); * // => logs the number of milliseconds it took for the deferred function to be invoked */ - var now = nativeNow || function() { + function now() { return new Date().getTime(); - }; + } /*------------------------------------------------------------------------*/ @@ -8679,9 +8677,9 @@ * _.isFinite(Infinity); * // => false */ - var isFinite = nativeNumIsFinite || function(value) { + function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); - }; + } /** * Checks if `value` is classified as a `Function` object.