mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Ensure _#plant resets iterator data of the cloned sequence.
This commit is contained in:
16
test/test.js
16
test/test.js
@@ -16637,6 +16637,22 @@
|
||||
skipTest(2);
|
||||
}
|
||||
});
|
||||
|
||||
test('should reset iterator data on cloned sequences', 2, function() {
|
||||
if (!isNpm) {
|
||||
var array1 = [2, 4],
|
||||
array2 = [6, 8],
|
||||
wrapped1 = _(array1).map(square);
|
||||
|
||||
deepEqual(_.toArray(wrapped1), [4, 16]);
|
||||
|
||||
var wrapped2 = wrapped1.plant(array2);
|
||||
deepEqual(_.toArray(wrapped2), [36, 64]);
|
||||
}
|
||||
else {
|
||||
skipTest(2);
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user