Ensure shortcut fusion works for _.at with no indexes specified.

This commit is contained in:
John-David Dalton
2015-11-14 20:50:18 -08:00
parent 64a7503196
commit 45f07d5014
2 changed files with 11 additions and 8 deletions

View File

@@ -13895,8 +13895,11 @@
LazyWrapper.prototype.at = rest(function(paths) {
paths = baseFlatten(paths);
return (paths.length == 1 && isIndex(paths[0]))
? this.slice(paths[0], +paths[0] + 1)
var length = paths.length,
start = length ? paths[0] : 0;
return (length < 2 && isIndex(start))
? this.slice(start, length ? (+start + 1) : start)
: new LazyWrapper(this);
});