mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Cleanup _.isEqual comments and ensure _.isEmpty/_.size detect arguments objects correctly.
Former-commit-id: 75b044d27b990d55393bf27234aad6ce369f6abe
This commit is contained in:
16
test/test.js
16
test/test.js
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user