Skip to content

Commit

Permalink
fix($limitTo): properly handle excessive limits
Browse files Browse the repository at this point in the history
  • Loading branch information
TEHEK committed Sep 24, 2011
1 parent 2508768 commit c36bab6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ var angularArray = {
expect(binding('numbers.$limitTo(limit) | json')).toEqual('[1,2,3]');
});
it('should update the output when -3 is entered', function() {
it('should update the output when -3 is entered', function() {
input('limit').enter(-3);
expect(binding('numbers.$limitTo(limit) | json')).toEqual('[7,8,9]');
});
Expand All @@ -723,8 +723,6 @@ var angularArray = {
input('limit').enter(100);
expect(binding('numbers.$limitTo(limit) | json')).toEqual('[1,2,3,4,5,6,7,8,9]');
});
</doc:scenario>
</doc:example>
*/
Expand Down
1 change: 1 addition & 0 deletions test/ApiSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ describe('api', function(){
expect(angular.Array.limitTo({}, 1)).toEqual([]);
});


it('should return a copy of input array if X is exceeds array length', function () {
expect(angular.Array.limitTo(items, 19)).toEqual(items);
expect(angular.Array.limitTo(items, '9')).toEqual(items);
Expand Down

0 comments on commit c36bab6

Please sign in to comment.