diff --git a/lodash.js b/lodash.js index 95ce9399e..8c56c3a83 100644 --- a/lodash.js +++ b/lodash.js @@ -11434,7 +11434,7 @@ return !value.size; } if (isPrototype(value)) { - return !nativeKeys(value).length; + return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { diff --git a/test/test.js b/test/test.js index 7b6595197..eaf3e6c4d 100644 --- a/test/test.js +++ b/test/test.js @@ -9366,6 +9366,18 @@ assert.strictEqual(_.isEmpty(args), false); }); + QUnit.test('should work with prototytpe objects', function(assert) { + assert.expect(2); + + function Foo() {} + Foo.prototype = { 'constructor': Foo }; + + assert.strictEqual(_.isEmpty(Foo.prototype), true); + + Foo.prototype.a = 1; + assert.strictEqual(_.isEmpty(Foo.prototype), false); + }); + QUnit.test('should work with jQuery/MooTools DOM query collections', function(assert) { assert.expect(1);