mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Fix lazy sequence test fails.
This commit is contained in:
13
lodash.js
13
lodash.js
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user