Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug `indexOf`. when arr is number, it was return 0

  • Loading branch information...
commit 460925c2c65af3ba25bff4cfaacfc9f3bfd603b9 1 parent d998ecd
@hokaccha hokaccha authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 expect.js
View
4 expect.js
@@ -449,6 +449,10 @@
return Array.prototype.indexOf.call(arr, o, i);
}
+ if (arr.length === undefined) {
+ return -1;
+ }
+
for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0
; i < j && arr[i] !== o; i++);
Please sign in to comment.
Something went wrong with that request. Please try again.