From ce3cc559442b580f971f763b81a58d5071c89645 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 29 Sep 2008 09:40:52 +0000 Subject: [PATCH] make sure all calls to command actions use sensible defaults --- content/commands.js | 5 +++++ content/options.js | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/content/commands.js b/content/commands.js index 615afe15..f037db45 100644 --- a/content/commands.js +++ b/content/commands.js @@ -86,6 +86,11 @@ liberator.Command.prototype = { execute: function (args, special, count, modifiers) { + // XXX + special = !!special; + count = (count === undefined) ? -1 : count; + modifiers = modifiers || {}; + // whenever the user specifies special options or fixed number of arguments // we use our args parser instead of passing a string to the callback if (this.options.length > 0 || this.argCount) diff --git a/content/options.js b/content/options.js index 0e7320c7..562e8b7b 100644 --- a/content/options.js +++ b/content/options.js @@ -482,10 +482,7 @@ liberator.Options = function () //{{{ if (name == "all") all = true; - var scope = liberator.options.OPTION_SCOPE_BOTH; - if (modifiers && modifiers.scope) - scope = modifiers.scope; - + var scope = modifiers.scope || liberator.options.OPTION_SCOPE_BOTH; var option = liberator.options.get(name, scope); if (!option && !all)