mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Ensure the callback of _.filter can't modify the resulting value.
Former-commit-id: 6652dc5926390e8418b524c7ffd2347c2fa65c82
This commit is contained in:
14
test/test.js
14
test/test.js
@@ -427,6 +427,20 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.filter');
|
||||
|
||||
(function() {
|
||||
test('should not modify the resulting value from within `callback`', function() {
|
||||
var actual = _.filter([0], function(value, index, array) {
|
||||
return (array[index] = 1);
|
||||
});
|
||||
|
||||
deepEqual(actual, [0]);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.find');
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user