Skip to content

Commit

Permalink
fixes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Sep 27, 2011
1 parent 53ed2fa commit b03315e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions es5-shim.js
Expand Up @@ -436,7 +436,7 @@ if (!Array.prototype.indexOf) {
i = toInteger(arguments[1]);

// handle negative indices
i = i >= 0 ? i : length - Math.abs(i);
i = i >= 0 ? i : Math.max(0, length + i);
for (; i < length; i++) {
if (i in self && self[i] === sought) {
return i;
Expand All @@ -458,7 +458,7 @@ if (!Array.prototype.lastIndexOf) {
return -1;
var i = length - 1;
if (arguments.length > 1)
i = toInteger(arguments[1]);
i = Math.min(i, toInteger(arguments[1]));
// handle negative indices
i = i >= 0 ? i : length - Math.abs(i);
for (; i >= 0; i--) {
Expand Down

0 comments on commit b03315e

Please sign in to comment.