mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Cleanup join, pop, shift chaining setup code.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -9631,13 +9631,13 @@
|
|||||||
arrayEach(['join', 'pop', 'shift'], function(methodName) {
|
arrayEach(['join', 'pop', 'shift'], function(methodName) {
|
||||||
var func = arrayProto[methodName];
|
var func = arrayProto[methodName];
|
||||||
lodash.prototype[methodName] = function() {
|
lodash.prototype[methodName] = function() {
|
||||||
var chainAll = this.__chain__;
|
var args = arguments;
|
||||||
if (!chainAll) {
|
if (!this.__chain__) {
|
||||||
return func.apply(this.value(), arguments);
|
return func.apply(this.value(), args);
|
||||||
}
|
}
|
||||||
var result = new lodashWrapper(this.__wrapped__, chainAll, baseSlice(this.__queue__));
|
return this.tap(function(value) {
|
||||||
result.__queue__.push([func, null, arguments]);
|
return func.apply(value, args);
|
||||||
return result;
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user