Fix lazy sequence test fails.

This commit is contained in:
John-David Dalton
2016-12-08 22:28:27 -08:00
parent 5ee5099af1
commit b51786e72e

View File

@@ -1876,7 +1876,7 @@
resIndex = 0, resIndex = 0,
takeCount = nativeMin(length, this.__takeCount__); takeCount = nativeMin(length, this.__takeCount__);
if (!isArr || (arrLength == length && takeCount == length)) { if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
return baseWrapperValue(array, this.__actions__); return baseWrapperValue(array, this.__actions__);
} }
var result = []; var result = [];
@@ -16836,14 +16836,13 @@
// Add `LazyWrapper` methods for `_.drop` and `_.take` variants. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
arrayEach(['drop', 'take'], function(methodName, index) { arrayEach(['drop', 'take'], function(methodName, index) {
LazyWrapper.prototype[methodName] = function(n) { LazyWrapper.prototype[methodName] = function(n) {
var filtered = this.__filtered__;
if (filtered && !index) {
return new LazyWrapper(this);
}
n = n === undefined ? 1 : nativeMax(toInteger(n), 0); n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = this.clone(); var result = (this.__filtered__ && !index)
if (filtered) { ? new LazyWrapper(this)
: this.clone();
if (result.__filtered__) {
result.__takeCount__ = nativeMin(n, result.__takeCount__); result.__takeCount__ = nativeMin(n, result.__takeCount__);
} else { } else {
result.__views__.push({ result.__views__.push({