From 7ccb038b6d6ebcb306715406f0d3d20676968967 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 31 May 2012 17:40:47 -0600 Subject: [PATCH] Add `_.isEmpty` unit test. Former-commit-id: 066961a929da280421083d3f9d66b838d3d29dfd --- test/test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test.js b/test/test.js index 6442e4d96..d2e3c80f1 100644 --- a/test/test.js +++ b/test/test.js @@ -307,6 +307,16 @@ test('fixes the JScript [[DontEnum]] bug (test in IE < 9)', function() { equal(_.isEmpty(shadowed), false); }); + + test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { + function Foo() {} + Foo.prototype.a = 1; + + equal(_.isEmpty(Foo), true); + + Foo.prototype = { 'a': 1 }; + equal(_.isEmpty(Foo), true); + }); }()); /*--------------------------------------------------------------------------*/