From a4863d52448170a8b94fa1fd2df79af1b66b6ad1 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sun, 27 Mar 2011 16:19:03 -0700 Subject: correct size() impl for object's w/ 'length' prop the original implementation returned incorrect value value for objects with 'length' property. --- test/AngularSpec.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/AngularSpec.js') diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 0a290381..61dc7cfc 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -133,6 +133,10 @@ describe('angular', function(){ expect(size('')).toBe(0); expect(size('abc')).toBe(3); }); + + it('should not rely on length property of an object to determine its size', function() { + expect(size({length:99})).toBe(1); + }); }); -- cgit v1.2.3