From aa8f568c6c3be795c17c3b5107a8a8c70fc6e930 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 26 Mar 2016 11:23:51 +0000 Subject: Fix inappropriate variable name. "description" is the first element here, not all elements. So "descriptor" is a better name. --- background_scripts/commands.coffee | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 6c452242..b58a3b0c 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -1,7 +1,7 @@ Commands = init: -> - for own command, description of commandDescriptions - @addCommand(command, description[0], description[1]) + for own command, descriptor of commandDescriptions + @addCommand(command, descriptor[0], descriptor[1]) @loadKeyMappings Settings.get "keyMappings" Settings.postUpdateHooks["keyMappings"] = @loadKeyMappings.bind this @@ -18,12 +18,11 @@ Commands = # - background: whether this command needs to be run against the background page. # - passCountToFunction: true if this command should have any digits which were typed prior to the # command passed to it. This is used to implement e.g. "closing of 3 tabs". - addCommand: (command, description, options) -> + addCommand: (command, description, options = {}) -> if command of @availableCommands BgUtils.log "#{command} is already defined! Check commands.coffee for duplicates." return - options ||= {} @availableCommands[command] = extend options, description: description mapKeyToCommand: ({ key, command, options }) -> -- cgit v1.2.3