1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-02 14:02:26 +01:00

Remove Array.prototype.{find,findIndex} polyfills.

This commit is contained in:
Doug Kearns
2015-04-07 03:33:22 +10:00
parent 3c682b6a8d
commit dd61d50ec6
2 changed files with 1 additions and 29 deletions

View File

@@ -30,30 +30,6 @@ let { __lookupGetter__, __lookupSetter__, __defineGetter__, __defineSetter__,
hasOwnProperty = Function.call.bind(hasOwnProperty);
propertyIsEnumerable = Function.call.bind(propertyIsEnumerable);
// Gecko 24.
if (!("find" in Array.prototype))
Object.defineProperty(Array.prototype, "find", {
configurable: true,
writable: true,
value: function Array_find(pred, self) {
for (let [i, elem] of this.entries())
if (pred.call(self, elem, i, this))
return elem;
}
});
if (!("findIndex" in Array.prototype))
Object.defineProperty(Array.prototype, "findIndex", {
configurable: true,
writable: true,
value: function Array_findIndex(pred, self) {
for (let [i, elem] of this.entries())
if (pred.call(self, elem, i, this))
return i;
return -1;
}
});
function require(module_, target) {
if (/^[A-Za-z0-9]+:/.test(module_))
return module(module_);