mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Bump to v3.10.0.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
define(['../internal/baseCallback', '../internal/isIterateeCall', '../internal/isObjectLike', './matches'], function(baseCallback, isIterateeCall, isObjectLike, matches) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
||||
* and arguments of the created function. If `func` is a property name the
|
||||
@@ -40,7 +43,7 @@ define(['../internal/baseCallback', '../internal/isIterateeCall', '../internal/i
|
||||
*/
|
||||
function callback(func, thisArg, guard) {
|
||||
if (guard && isIterateeCall(func, thisArg, guard)) {
|
||||
thisArg = null;
|
||||
thisArg = undefined;
|
||||
}
|
||||
return isObjectLike(func)
|
||||
? matches(func)
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
define(['../internal/arrayCopy', '../internal/baseFunctions', '../lang/isFunction', '../lang/isObject', '../object/keys'], function(arrayCopy, baseFunctions, isFunction, isObject, keys) {
|
||||
|
||||
/** Used for native method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
|
||||
/** Native method references. */
|
||||
var push = arrayProto.push;
|
||||
define(['../internal/arrayCopy', '../internal/arrayPush', '../internal/baseFunctions', '../lang/isFunction', '../lang/isObject', '../object/keys'], function(arrayCopy, arrayPush, baseFunctions, isFunction, isObject, keys) {
|
||||
|
||||
/**
|
||||
* Adds all own enumerable function properties of a source object to the
|
||||
@@ -72,9 +66,7 @@ define(['../internal/arrayCopy', '../internal/baseFunctions', '../lang/isFunctio
|
||||
result.__chain__ = chainAll;
|
||||
return result;
|
||||
}
|
||||
var args = [this.value()];
|
||||
push.apply(args, arguments);
|
||||
return func.apply(object, args);
|
||||
return func.apply(object, arrayPush([this.value()], arguments));
|
||||
};
|
||||
}(func));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
define(['../internal/isIterateeCall'], function(isIterateeCall) {
|
||||
|
||||
/** Native method references. */
|
||||
var ceil = Math.ceil;
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
var nativeCeil = Math.ceil,
|
||||
nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Creates an array of numbers (positive and/or negative) progressing from
|
||||
@@ -41,7 +42,7 @@ define(['../internal/isIterateeCall'], function(isIterateeCall) {
|
||||
*/
|
||||
function range(start, end, step) {
|
||||
if (step && isIterateeCall(start, end, step)) {
|
||||
end = step = null;
|
||||
end = step = undefined;
|
||||
}
|
||||
start = +start || 0;
|
||||
step = step == null ? 1 : (+step || 0);
|
||||
@@ -55,7 +56,7 @@ define(['../internal/isIterateeCall'], function(isIterateeCall) {
|
||||
// Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
|
||||
// See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
|
||||
var index = -1,
|
||||
length = nativeMax(ceil((end - start) / (step || 1)), 0),
|
||||
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
|
||||
result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
define(['../internal/bindCallback', '../internal/root'], function(bindCallback, root) {
|
||||
|
||||
/** Native method references. */
|
||||
var floor = Math.floor;
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeIsFinite = root.isFinite,
|
||||
var nativeFloor = Math.floor,
|
||||
nativeIsFinite = root.isFinite,
|
||||
nativeMin = Math.min;
|
||||
|
||||
/** Used as references for the maximum length and index of an array. */
|
||||
@@ -38,7 +36,7 @@ define(['../internal/bindCallback', '../internal/root'], function(bindCallback,
|
||||
* // => also invokes `mage.castSpell(n)` three times
|
||||
*/
|
||||
function times(n, iteratee, thisArg) {
|
||||
n = floor(n);
|
||||
n = nativeFloor(n);
|
||||
|
||||
// Exit early to avoid a JSC JIT bug in Safari 8
|
||||
// where `Array(0)` is treated as `Array(1)`.
|
||||
|
||||
Reference in New Issue
Block a user