Fix build.

Former-commit-id: 99b283a2f26a9f5973799ad6757bfdc57d0a0404
This commit is contained in:
John-David Dalton
2013-04-13 14:22:29 -07:00
parent 0275e99fe2
commit 883d5917f5
2 changed files with 32 additions and 31 deletions

View File

@@ -4357,36 +4357,36 @@
lodash.prototype.chain = wrapperChain;
lodash.prototype.value = wrapperValueOf;
// add `Array` mutator functions to the wrapper
forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
var value = this.__wrapped__;
func.apply(value, arguments);
// add `Array` mutator functions to the wrapper
forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
var value = this.__wrapped__;
func.apply(value, arguments);
// avoid array-like object bugs with `Array#shift` and `Array#splice`
// in Firefox < 10 and IE < 9
if (!support.spliceObjects && value.length === 0) {
delete value[0];
}
return this;
};
});
// avoid array-like object bugs with `Array#shift` and `Array#splice`
// in Firefox < 10 and IE < 9
if (!support.spliceObjects && value.length === 0) {
delete value[0];
}
return this;
};
});
// add `Array` accessor functions to the wrapper
forEach(['concat', 'join', 'slice'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
var value = this.__wrapped__,
result = func.apply(value, arguments);
// add `Array` accessor functions to the wrapper
forEach(['concat', 'join', 'slice'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
var value = this.__wrapped__,
result = func.apply(value, arguments);
if (this.__chain__) {
result = new lodashWrapper(result);
result.__chain__ = true;
}
return result;
};
});
if (this.__chain__) {
result = new lodashWrapper(result);
result.__chain__ = true;
}
return result;
};
});
/*--------------------------------------------------------------------------*/