From 90b66eddf5d0846f2f3fd45553c5b073ed197d5d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 5 Aug 2012 22:29:14 -0700 Subject: [PATCH] Add `_.keys` unit test for `arguments` objects. Former-commit-id: dd90a9d3dc973a6ea8dce0c10ad511cce82097dd --- test/test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 5f2301146..37f22caee 100644 --- a/test/test.js +++ b/test/test.js @@ -712,7 +712,7 @@ 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; }; equal(_.isEqual(true, false), true); delete Boolean.prototype.isEqual; @@ -758,6 +758,12 @@ QUnit.module('lodash.keys'); (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() { function Foo() {} Foo.prototype.a = 1; @@ -779,7 +785,7 @@ Foo.prototype = { 'c': 3 }; deepEqual(_.keys(Foo), expected); }); - }()); + }(1, 2, 3)); /*--------------------------------------------------------------------------*/