mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
correct size() impl for object's w/ 'length' prop
the original implementation returned incorrect value value for objects with 'length' property.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user