mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-06 08:35:48 +01:00
Fix Firefox 24.
This commit is contained in:
@@ -30,6 +30,30 @@ let { __lookupGetter__, __lookupSetter__, __defineGetter__, __defineSetter__,
|
|||||||
hasOwnProperty = Function.call.bind(hasOwnProperty);
|
hasOwnProperty = Function.call.bind(hasOwnProperty);
|
||||||
propertyIsEnumerable = Function.call.bind(propertyIsEnumerable);
|
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] in Iterator(this))
|
||||||
|
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] in Iterator(this))
|
||||||
|
if (pred.call(self, elem, i, this))
|
||||||
|
return i;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function require(module_, target) {
|
function require(module_, target) {
|
||||||
if (/^[A-Za-z0-9]+:/.test(module_))
|
if (/^[A-Za-z0-9]+:/.test(module_))
|
||||||
return module(module_);
|
return module(module_);
|
||||||
|
|||||||
Reference in New Issue
Block a user