polyfill-service
Version:
A polyfill combinator
1 lines • 1.4 kB
JSON
{"aliases":["default","es5","modernizr:es5array"],"browsers":{"ie":"6 - 8"},"spec":"http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.lastindexof","docs":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf","baseDir":"Array/prototype/lastIndexOf","hasTests":true,"rawSource":"\n// Array.prototype.lastIndexOf\nArray.prototype.lastIndexOf = function lastIndexOf(searchElement) {\n\tif (this === undefined || this === null) {\n\t\tthrow new TypeError(this + 'is not an object');\n\t}\n\n\tvar\n\tarraylike = this instanceof String ? this.split('') : this,\n\tlength = Math.max(Math.min(arraylike.length, 9007199254740991), 0) || 0,\n\tindex = Number(arguments[1]) || 0;\n\n\tindex = 1 in arguments ? (index < 0 ? Math.max(length + index, 0) : index) + 1 : length;\n\n\twhile (--index >= 0) {\n\t\tif (index in arraylike && arraylike[index] === searchElement) {\n\t\t\treturn index;\n\t\t}\n\t}\n\n\treturn -1;\n};\n","minSource":"Array.prototype.lastIndexOf=function(t){if(void 0===this||null===this)throw new TypeError(this+\"is not an object\");var i=this instanceof String?this.split(\"\"):this,n=Math.max(Math.min(i.length,9007199254740991),0)||0,r=Number(arguments[1])||0;r=1 in arguments?(0>r?Math.max(n+r,0):r)+1:n;for(;--r>=0;)if(r in i&&i[r]===t)return r;return-1};","detectSource":"'lastIndexOf' in Array.prototype"}