Cleanup _.isEqual comments and ensure _.isEmpty/_.size detect arguments objects correctly.

Former-commit-id: 75b044d27b990d55393bf27234aad6ce369f6abe
This commit is contained in:
John-David Dalton
2012-07-20 02:06:13 -04:00
parent a192410498
commit befe0fccaf
4 changed files with 85 additions and 69 deletions

View File

@@ -546,6 +546,8 @@
QUnit.module('lodash.isEmpty');
(function() {
var args = arguments;
test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() {
equal(_.isEmpty(shadowed), false);
});
@@ -558,7 +560,15 @@
Foo.prototype = { 'a': 1 };
equal(_.isEmpty(Foo), true);
});
}());
test('should work with an object that has a `length` property', function() {
equal(_.isEmpty({ 'length': 0 }), false);
});
test('should work with `arguments` objects (test in IE < 9)', function() {
equal(_.isEmpty(args), false);
});
}(1, 2, 3));
/*--------------------------------------------------------------------------*/
@@ -784,6 +794,10 @@
deepEqual(actual, [0, 0, 0, 0, 0]);
});
test('should work with an object that has a `length` property', function() {
equal(_.size({ 'length': 3 }), 1);
});
test('should work with `arguments` objects (test in IE < 9)', function() {
equal(_.size(args), 3);
});