Fix failing clone tests.

This commit is contained in:
John-David Dalton
2014-10-15 22:49:03 -07:00
parent 71fc4faae7
commit b5f0672888
2 changed files with 3 additions and 2 deletions

View File

@@ -1508,6 +1508,8 @@
if (result === null) {
isDeep = false;
result = {};
} else if (isDeep) {
isDeep = toString.call(result) == objectClass;
}
}
if (!isDeep || result === value) {

View File

@@ -1643,7 +1643,6 @@
_.forOwn(objects, function(object, key) {
test('`_.' + methodName + '` should clone ' + key, 2, function() {
var actual = func(object);
ok(_.isEqual(actual, object));
if (_.isObject(object)) {
@@ -1656,7 +1655,7 @@
_.forOwn(nonCloneable, function(object, key) {
test('`_.' + methodName + '` should not clone ' + key, 1, function() {
deepEqual(func(object), {});
deepEqual(func(object), object && {});
});
});