|
878 | 878 | deepEqual(lodash.defaults({}, new Foo), Foo.prototype, '_.defaults should assign inherited `source` properties: ' + basename);
|
879 | 879 | deepEqual(lodash.extend({}, new Foo), Foo.prototype, '_.extend should assign inherited `source` properties: ' + basename);
|
880 | 880 |
|
881 |
| - actual = lodash.extend({}, { 'a': 0 }, function(a, b) { |
882 |
| - return this[b]; |
883 |
| - }, [2]); |
| 881 | + var callback = function(a, b) { |
| 882 | + actual = this[b]; |
| 883 | + }; |
884 | 884 |
|
| 885 | + actual = lodash.extend({}, { 'a': 0 }, callback, [2]); |
885 | 886 | strictEqual(actual.a, 0, '_.extend should ignore `callback` and `thisArg`: ' + basename);
|
886 | 887 |
|
887 | 888 | actual = lodash.find(array, function(value) {
|
|
899 | 900 | equal(last, _.last(array), '_.forEach should not exit early: ' + basename);
|
900 | 901 | equal(actual, undefined, '_.forEach should return `undefined`: ' + basename);
|
901 | 902 |
|
902 |
| - lodash.forEach([1], function(value, index) { |
903 |
| - actual = this[index]; |
904 |
| - }, [2]); |
905 |
| - |
| 903 | + lodash.forEach([1], callback, [2]); |
906 | 904 | equal(actual, 2, '_.forEach supports the `thisArg` argument when iterating arrays: ' + basename);
|
907 | 905 |
|
908 |
| - lodash.forEach({ 'a': 1 }, function(value, key) { |
909 |
| - actual = this[key]; |
910 |
| - }, { 'a': 2 }); |
911 |
| - |
| 906 | + lodash.forEach({ 'a': 1 }, callback, { 'a': 2 }); |
912 | 907 | equal(actual, 2, '_.forEach supports the `thisArg` argument when iterating objects: ' + basename);
|
913 | 908 |
|
914 | 909 | array = [{ 'a': [1, 2] }, { 'a': [3] }];
|
|
0 commit comments