From 57e3f1a5ff240a8de44dadf2273ab97f6762eae7 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 21 Nov 2010 13:00:43 -0500 Subject: [PATCH] Deal with default values when providing command option completion. Closes issue #146. --- common/content/commands.js | 2 +- common/content/events.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/content/commands.js b/common/content/commands.js index 4593cd1c..be57f958 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -760,7 +760,7 @@ const Commands = Module("commands", { function matchOpts(arg) { // Push possible option matches into completions if (complete && !onlyArgumentsRemaining) - completeOpts = options.filter(function (opt) opt.multiple || !(opt.names[0] in args)); + completeOpts = options.filter(function (opt) opt.multiple || !set.has(args, opt.names[0])); } function resetCompletions() { completeOpts = null; diff --git a/common/content/events.js b/common/content/events.js index dedaaa21..821ff08f 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -364,6 +364,7 @@ const Events = Module("events", { if (target instanceof Document) target = target.documentElement; dactyl.assert(target); + // This causes a crash on Gecko<2.0, it seems. target.ownerDocument.defaultView .QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)