diff --git a/common/content/commands.js b/common/content/commands.js index 1104511e..dc4410bc 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -222,11 +222,10 @@ const Command = Class("Command", { * @param {Array} specs An array of command name specs to parse. * @returns {Array} */ - parseSpecs: function (specs) { + parseSpecs: function parseSpecs(specs) { return specs.map(function (spec) { - let long = spec.replace(/[[\]]/g, ""); - let short = spec.replace(/\[.*]/, ""); - return short == long ? [long] : [long, short]; + let [, head, tail] = spec.match(/(\w+)(?:\[(.*)])?/); + return tail ? [head + tail, head] : [head]; }); } }); diff --git a/common/content/completion.js b/common/content/completion.js index 7b18b287..16aa7398 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -740,7 +740,7 @@ const Completion = Module("completion", { } //}}} }, { - UrlCompleter: Struct("name", "description", "completer"), + UrlCompleter: Struct("name", "description", "completer") }); // vim: set fdm=marker sw=4 ts=4 et: diff --git a/common/content/javascript.js b/common/content/javascript.js index 45703034..98804f7c 100644 --- a/common/content/javascript.js +++ b/common/content/javascript.js @@ -610,5 +610,5 @@ const JavaScript = Module("javascript", { }, getter: function () services.get("debugger").isOn }); - }, + } }) diff --git a/common/content/util.js b/common/content/util.js index a07a88a3..e313747d 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -873,7 +873,7 @@ const Util = Module("util", { } return ret; } - }), + }) }); // vim: set fdm=marker sw=4 ts=4 et: