From 5cba6cbc773065bdc20cb7819f69e4e8550b041f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 28 Jan 2011 10:10:10 -0500 Subject: [PATCH] Fix :dia completion. --- common/content/dactyl.js | 2 +- common/modules/base.jsm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 84082d1e..76db2f82 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1642,7 +1642,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { bang: true, completer: function (context) { context.ignoreCase = true; - return completion.dialog(context); + completion.dialog(context); } }); diff --git a/common/modules/base.jsm b/common/modules/base.jsm index efdbd106..9e04c492 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -758,6 +758,7 @@ Class.memoize = function memoize(getter) this.get = function replace() let (obj = this.instance || this) ( Class.replaceProperty(obj, key, null), Class.replaceProperty(obj, key, getter.call(this, key))) + this.set = function replace(val) Class.replaceProperty(this.instance || this, val); } }); @@ -1246,6 +1247,9 @@ update(iter, { * given predicate. */ nth: function nth(iter, pred, n, self) { + if (typeof pred === "number") + [pred, n] = [function () true, pred]; // Hack. + for (let elem in iter) if (pred.call(self, elem) && n-- === 0) return elem;