mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Fix unit test for rhino/ringo.
This commit is contained in:
11
test/test.js
11
test/test.js
@@ -1741,13 +1741,18 @@
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
test('should create a callback with a falsey `thisArg`', 1, function() {
|
test('should create a callback with a falsey `thisArg`', 1, function() {
|
||||||
|
var fn = function() { return this; };
|
||||||
|
|
||||||
var expected = _.map(falsey, function(value) {
|
var expected = _.map(falsey, function(value) {
|
||||||
return Object(value == null ? root : value);
|
var result = fn.call(value);
|
||||||
|
return (result && result.Array) ? root : result;
|
||||||
});
|
});
|
||||||
|
|
||||||
var actual = _.map(falsey, function(value) {
|
var actual = _.map(falsey, function(value) {
|
||||||
var callback = _.callback(function() { return this; }, value);
|
var callback = _.callback(fn, value),
|
||||||
return callback();
|
result = callback();
|
||||||
|
|
||||||
|
return (result && result.Array) ? root : result;
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(_.isEqual(actual, expected));
|
ok(_.isEqual(actual, expected));
|
||||||
|
|||||||
Reference in New Issue
Block a user