mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-10 18:45:48 +01:00
Settle stupid naming dispute.
This commit is contained in:
@@ -1071,17 +1071,6 @@ const array = Class("array", Array, {
|
||||
equals: function (ary1, ary2)
|
||||
ary1.length === ary2.length && Array.every(ary1, function (e, i) e === ary2[i]),
|
||||
|
||||
/**
|
||||
* Returns the first member of the given array that matches the
|
||||
* given predicate.
|
||||
*/
|
||||
first: function first(ary, pred, self) {
|
||||
for (let elem in values(ary))
|
||||
if (pred.call(self, elem))
|
||||
return elem;
|
||||
return undefined;
|
||||
},
|
||||
|
||||
/**
|
||||
* Flattens an array, such that all elements of the array are
|
||||
* joined into a single array:
|
||||
@@ -1116,6 +1105,17 @@ const array = Class("array", Array, {
|
||||
yield [i, ary[i]];
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the nth member of the given array that matches the
|
||||
* given predicate.
|
||||
*/
|
||||
nth: function first(ary, pred, n, self) {
|
||||
for (let elem in values(ary))
|
||||
if (pred.call(self, elem) && n-- === 0)
|
||||
return elem;
|
||||
return undefined;
|
||||
},
|
||||
|
||||
/**
|
||||
* Filters out all duplicates from an array. If *unsorted* is false, the
|
||||
* array is sorted before duplicates are removed.
|
||||
|
||||
@@ -624,8 +624,7 @@ const Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakR
|
||||
["prompt", "Always prompt for a lifetime"],
|
||||
["session", "The current session"]
|
||||
],
|
||||
getter: function () (this.completer()[prefs.get(this.PREF)]
|
||||
|| [prefs.get(this.PREF_DAYS)])[0],
|
||||
getter: function () (this.completer()[prefs.get(this.PREF)] || [prefs.get(this.PREF_DAYS)])[0],
|
||||
setter: function (value) {
|
||||
let val = this.completer().map(function (i) i[0]).indexOf(value);
|
||||
if (val > -1)
|
||||
|
||||
Reference in New Issue
Block a user