Fixed range checking for insertObject:atIndex:

This commit is contained in:
Aparajita Fishman
2011-08-08 15:14:30 -07:00
parent f8404c7a97
commit 8e203ec78e
+1 -1
View File
@@ -209,7 +209,7 @@ var concat = Array.prototype.concat,
- (void)insertObject:(id)anObject atIndex:(int)anIndex
{
if (anIndex >= self.length || anIndex < 0)
if (anIndex > self.length || anIndex < 0)
_CPRaiseRangeException(self, _cmd, anIndex, self.length);
splice.call(self, anIndex, 0, anObject);