mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Add _.keys unit test for arguments objects.
Former-commit-id: dd90a9d3dc973a6ea8dce0c10ad511cce82097dd
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -712,7 +712,7 @@
|
|||||||
equal(_.isEqual(object, object), false);
|
equal(_.isEqual(object, object), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should use custom `isEqual` method on primitives', function() {
|
test('should use custom `isEqual` methods on primitives', function() {
|
||||||
Boolean.prototype.isEqual = function() { return true; };
|
Boolean.prototype.isEqual = function() { return true; };
|
||||||
equal(_.isEqual(true, false), true);
|
equal(_.isEqual(true, false), true);
|
||||||
delete Boolean.prototype.isEqual;
|
delete Boolean.prototype.isEqual;
|
||||||
@@ -758,6 +758,12 @@
|
|||||||
QUnit.module('lodash.keys');
|
QUnit.module('lodash.keys');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
var args = arguments;
|
||||||
|
|
||||||
|
test('should work with `arguments` objects (test in IE < 9)', function() {
|
||||||
|
deepEqual(_.keys(args), ['0', '1', '2']);
|
||||||
|
});
|
||||||
|
|
||||||
test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() {
|
test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() {
|
||||||
function Foo() {}
|
function Foo() {}
|
||||||
Foo.prototype.a = 1;
|
Foo.prototype.a = 1;
|
||||||
@@ -779,7 +785,7 @@
|
|||||||
Foo.prototype = { 'c': 3 };
|
Foo.prototype = { 'c': 3 };
|
||||||
deepEqual(_.keys(Foo), expected);
|
deepEqual(_.keys(Foo), expected);
|
||||||
});
|
});
|
||||||
}());
|
}(1, 2, 3));
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user