1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 18:24:11 +01:00

First work towards group-local option values.

This commit is contained in:
Kris Maglione
2011-08-23 22:42:38 -04:00
parent 9ad4be54a9
commit 435f30f7eb
7 changed files with 279 additions and 188 deletions

View File

@@ -1500,6 +1500,8 @@ update(iter, {
nth: function nth(iter, pred, n, self) {
if (typeof pred === "number")
[pred, n] = [function () true, pred]; // Hack.
if (n === undefined)
n = 0;
for (let elem in iter)
if (pred.call(self, elem) && n-- === 0)
@@ -1641,6 +1643,8 @@ var array = Class("array", Array, {
* given predicate.
*/
nth: function nth(ary, pred, n, self) {
if (n === undefined)
n = 0;
for (let elem in values(ary))
if (pred.call(self, elem) && n-- === 0)
return elem;