Optimize _.isEqual by using _.keys and ensure arguments objects are compared correctly.

This commit is contained in:
John-David Dalton
2014-06-08 13:14:23 -07:00
parent 9940d73167
commit 8572445f57
2 changed files with 60 additions and 60 deletions

View File

@@ -4661,7 +4661,7 @@
}
});
test('should treat `arguments` objects like `Object` objects', 2, function() {
test('should treat `arguments` objects like `Object` objects', 4, function() {
var args = (function() { return arguments; }(1, 2, 3)),
object = { '0': 1, '1': 2, '2': 3, 'length': 3 };
@@ -4669,12 +4669,14 @@
Foo.prototype = object;
strictEqual(_.isEqual(args, object), true);
strictEqual(_.isEqual(object, args), true);
if (!isPhantom) {
strictEqual(_.isEqual(args, new Foo), false);
strictEqual(_.isEqual(new Foo, args), false);
}
else {
skipTest();
skipTest(2);
}
});