-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba97460
commit 0697445
Showing
4 changed files
with
28 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function (undefined) { | ||
var detect = ( | ||
'indexOf' in Array.prototype | ||
) | ||
|
||
if (detect) return | ||
|
||
// Polyfill adapted from https://cdn.polyfill.io/v2/polyfill.js?features=Array.prototype.indexOf&flags=always | ||
Array.prototype.indexOf = function (searchElement, fromIndex) { | ||
fromIndex = Number(fromIndex) || 0 | ||
|
||
if (this === undefined || this === null) { | ||
throw new TypeError(this + ' is not an object') | ||
} | ||
|
||
var array = this instanceof String ? this.split('') : this | ||
var arrayLength = Math.max(Math.min(array.length, 9007199254740991), 0) || 0 | ||
var loopStartIndex = (fromIndex < 0 ? Math.max(arrayLength + fromIndex, 0) : fromIndex) - 1 | ||
|
||
for (var i = loopStartIndex; ++i < arrayLength;) { | ||
if (i in array && array[i] === searchElement) { | ||
return i | ||
} | ||
} | ||
return -1 | ||
} | ||
}).call(typeof window === 'object' && window || typeof self === 'object' && self || typeof global === 'object' && global || {}) |
File renamed without changes.