From e88490ef7d79130c68d3b7eda22dbb5536aa962c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 8 Apr 2011 04:48:34 -0400 Subject: [PATCH] Fix idiocy. Closes issue #496. --- common/content/mow.js | 2 +- common/modules/commands.jsm | 19 ++++++------------- common/modules/sanitizer.jsm | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/common/content/mow.js b/common/content/mow.js index da00d220..94cdfb51 100644 --- a/common/content/mow.js +++ b/common/content/mow.js @@ -311,7 +311,7 @@ var MOW = Module("mow", { mappings.add([modes.COMMAND], ["g"], "Redisplay the last command output", function () { - dactyl.assert(commandline.lastOutput, _("mow.noPreviousOutput")); + dactyl.assert(mow.lastOutput, _("mow.noPreviousOutput")); mow.echo(mow.lastOutput, "Normal"); }); diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index bb184933..eac37255 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -1411,20 +1411,13 @@ var Commands = Module("commands", { if (/^custom,/.test(completer)) { completer = completer.substr(7); - let context = update({}, contexts.context || {}); + if (contexts.context) + var ctxt = update({}, contexts.context || {}); completerFunc = function (context) { - try { - var result = contextswithSavedValues(["context"], function () { - contexts.context = context; - return dactyl.userEval(completer); - }); - } - catch (e) { - dactyl.echo(":" + this.name + " ..."); // XXX - dactyl.echoerr(_("command.unknownCompleter", completer)); - dactyl.log(e); - return undefined; - } + var result = contexts.withSavedValues(["context"], function () { + contexts.context = ctxt; + return dactyl.userEval(completer); + }); if (callable(result)) return result.apply(this, Array.slice(arguments)); else diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index 924aa4db..1d1c2611 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -669,7 +669,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef }, initialValue: true, persist: false, - validator: function (val) parseInt(val) == val || modules.Option.validateCompleter.call(this, val) + validator: function validator(val) parseInt(val) == val || validator.superapply(this, arguments) }); } });