From cc03bfadf8e1d38e2a1bc3c088b677a95a2bd706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Fri, 22 Jul 2011 12:33:36 +0200 Subject: [PATCH] Use [foo] instead of foo[] consistently in source doc type annotations. --- common/content/abbreviations.js | 10 +++++----- common/content/autocommands.js | 4 ++-- common/content/dactyl.js | 4 ++-- common/content/mappings.js | 24 ++++++++++++------------ common/content/tabs.js | 2 +- common/modules/base.jsm | 2 +- common/modules/commands.jsm | 14 +++++++------- common/modules/io.jsm | 4 ++-- common/modules/javascript.jsm | 4 ++-- common/modules/options.jsm | 16 ++++++++-------- common/modules/services.jsm | 4 ++-- common/modules/storage.jsm | 2 +- melodactyl/content/library.js | 6 +++--- melodactyl/content/player.js | 4 ++-- teledactyl/content/mail.js | 2 +- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index a39d0510..fc7ddc6e 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -17,7 +17,7 @@ * E.g. an abbreviation with a LHS of "gop" and RHS of "Grand Old Party" will * replace the former with the latter. * - * @param {Mode[]} modes The modes in which this abbreviation is active. + * @param {[Mode]} modes The modes in which this abbreviation is active. * @param {string} lhs The left hand side of the abbreviation; the text to * be replaced. * @param {string|function(nsIEditor):string} rhs The right hand side of @@ -53,7 +53,7 @@ var Abbreviation = Class("Abbreviation", { /** * Returns true if this abbreviation is defined for all *modes*. * - * @param {Mode[]} modes The modes to test. + * @param {[Mode]} modes The modes to test. * @returns {boolean} The result of the comparison. */ modesEqual: function (modes) array.equals(this.modes, modes), @@ -69,7 +69,7 @@ var Abbreviation = Class("Abbreviation", { /** * Returns true if this abbreviation is defined in any of *modes*. * - * @param {Modes[]} modes The modes to test. + * @param {[Modes]} modes The modes to test. * @returns {boolean} The result of the comparison. */ inModes: function (modes) modes.some(function (mode) this.inMode(mode), this), @@ -135,7 +135,7 @@ var AbbrevHive = Class("AbbrevHive", Contexts.Hive, { }, /** - * @property {Abbreviation[]} The list of the abbreviations merged from + * @property {[Abbreviation]} The list of the abbreviations merged from * each mode. */ get merged() { @@ -253,7 +253,7 @@ var Abbreviations = Module("abbreviations", { * * @param {Array} modes List of modes. * @param {string} lhs The LHS of the abbreviation. - * @param {Hive[]} hives List of hives. + * @param {[Hive]} hives List of hives. * @optional */ list: function (modes, lhs, hives) { diff --git a/common/content/autocommands.js b/common/content/autocommands.js index ed5d5b04..beb8fc52 100644 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -47,7 +47,7 @@ var AutoCmdHive = Class("AutoCmdHive", Contexts.Hive, { * * @param {string} event The event name filter. * @param {string} pattern The URL pattern filter. - * @returns {AutoCommand[]} + * @returns {[AutoCommand]} */ get: function (event, pattern) { return this._store.filter(function (autoCmd) autoCmd.match(event, regexp)); @@ -89,7 +89,7 @@ var AutoCommands = Module("autocommands", { * * @param {string} event The event name filter. * @param {string} regexp The URL pattern filter. - * @param {Hive[]} hives List of hives. + * @param {[Hive]} hives List of hives. * @optional */ list: function (event, regexp, hives) { diff --git a/common/content/dactyl.js b/common/content/dactyl.js index f1dc13ea..2bf1be5c 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1306,7 +1306,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { * ['www.google.com/search?q=bla', 'www.osnews.com'] * * @param {string} str - * @returns {string[]} + * @returns {[string]} */ parseURLs: function parseURLs(str) { let urls; @@ -1506,7 +1506,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }, /** - * @property {Window[]} Returns an array of all the host application's + * @property {[Window]} Returns an array of all the host application's * open windows. */ get windows() [win for (win in iter(services.windowMediator.getEnumerator("navigator:browser"))) if (win.dactyl)], diff --git a/common/content/mappings.js b/common/content/mappings.js index c68884bf..30495c4a 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -12,8 +12,8 @@ * A class representing key mappings. Instances are created by the * {@link Mappings} class. * - * @param {Modes.Mode[]} modes The modes in which this mapping is active. - * @param {string[]} keys The key sequences which are bound to + * @param {[Modes.Mode]} modes The modes in which this mapping is active. + * @param {[string]} keys The key sequences which are bound to * *action*. * @param {string} description A short one line description of the key mapping. * @param {function} action The action invoked by each key sequence. @@ -44,7 +44,7 @@ var Map = Class("Map", { name: Class.memoize(function () this.names[0]), - /** @property {string[]} All of this mapping's names (key sequences). */ + /** @property {[string]} All of this mapping's names (key sequences). */ names: Class.memoize(function () this._keys.map(function (k) events.canonicalKeys(k))), get toStringParams() [this.modes.map(function (m) m.name), this.names.map(String.quote)], @@ -53,7 +53,7 @@ var Map = Class("Map", { /** @property {number} A unique ID for this mapping. */ id: null, - /** @property {Modes.Mode[]} All of the modes for which this mapping applies. */ + /** @property {[Modes.Mode]} All of the modes for which this mapping applies. */ modes: null, /** @property {function (number)} The function called to execute this mapping. */ action: null, @@ -156,8 +156,8 @@ var MapHive = Class("MapHive", Contexts.Hive, { /** * Adds a new key mapping. * - * @param {Modes.Mode[]} modes The modes that this mapping applies to. - * @param {string[]} keys The key sequences which are bound to *action*. + * @param {[Modes.Mode]} modes The modes that this mapping applies to. + * @param {[string]} keys The key sequences which are bound to *action*. * @param {string} description A description of the key mapping. * @param {function} action The action invoked by each key sequence. * @param {Object} extra An optional extra configuration hash. @@ -348,8 +348,8 @@ var Mappings = Module("mappings", { /** * Adds a new default key mapping. * - * @param {Modes.Mode[]} modes The modes that this mapping applies to. - * @param {string[]} keys The key sequences which are bound to *action*. + * @param {[Modes.Mode]} modes The modes that this mapping applies to. + * @param {[string]} keys The key sequences which are bound to *action*. * @param {string} description A description of the key mapping. * @param {function} action The action invoked by each key sequence. * @param {Object} extra An optional extra configuration hash. @@ -370,8 +370,8 @@ var Mappings = Module("mappings", { /** * Adds a new user-defined key mapping. * - * @param {Modes.Mode[]} modes The modes that this mapping applies to. - * @param {string[]} keys The key sequences which are bound to *action*. + * @param {[Modes.Mode]} modes The modes that this mapping applies to. + * @param {[string]} keys The key sequences which are bound to *action*. * @param {string} description A description of the key mapping. * @param {function} action The action invoked by each key sequence. * @param {Object} extra An optional extra configuration hash (see @@ -399,7 +399,7 @@ var Mappings = Module("mappings", { * * @param {Modes.Mode} mode The mode to search. * @param {string} prefix The map prefix string to match. - * @returns {Map[]} + * @returns {[Map]} */ getCandidates: function (mode, prefix) this.hives.map(function (h) h.getCandidates(mode, prefix)) @@ -409,7 +409,7 @@ var Mappings = Module("mappings", { * Lists all user-defined mappings matching *filter* for the specified * *modes* in the specified *hives*. * - * @param {Modes.Mode[]} modes An array of modes to search. + * @param {[Modes.Mode]} modes An array of modes to search. * @param {string} filter The filter string to match. @optional * @param {[MapHive]} hives The map hives to list. @optional */ diff --git a/common/content/tabs.js b/common/content/tabs.js index 998ca0a5..6d2cea03 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -152,7 +152,7 @@ var Tabs = Module("tabs", { get localStore() this.getLocalStore(), /** - * @property {Object[]} The array of closed tabs for the current + * @property {[Object]} The array of closed tabs for the current * session. */ get closedTabs() JSON.parse(services.sessionStore.getClosedTabData(window)), diff --git a/common/modules/base.jsm b/common/modules/base.jsm index ac3d81c2..758c34e5 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -1510,7 +1510,7 @@ var array = Class("array", Array, { * as such: * [["a", "b"], ["c", "d"]] -> { a: "b", c: "d" } * - * @param {Array[]} assoc + * @param {[Array]} assoc * @... {string} 0 - Key * @... 1 - Value */ diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index d0a9a867..7d7093e9 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -94,7 +94,7 @@ update(CommandOption, { * A class representing Ex commands. Instances are created by * the {@link Commands} class. * - * @param {string[]} specs The names by which this command can be invoked. + * @param {[string]} specs The names by which this command can be invoked. * These are specified in the form "com[mand]" where "com" is a unique * command name prefix. * @param {string} description A short one line description of the command. @@ -209,19 +209,19 @@ var Command = Class("Command", { complained: Class.memoize(function () ({})), /** - * @property {string[]} All of this command's name specs. e.g., "com[mand]" + * @property {[string]} All of this command's name specs. e.g., "com[mand]" */ specs: null, - /** @property {string[]} All of this command's short names, e.g., "com" */ + /** @property {[string]} All of this command's short names, e.g., "com" */ shortNames: null, /** - * @property {string[]} All of this command's long names, e.g., "command" + * @property {[string]} All of this command's long names, e.g., "command" */ longNames: null, /** @property {string} The command's canonical name. */ name: null, - /** @property {string[]} All of this command's long and short names. */ + /** @property {[string]} All of this command's long and short names. */ names: null, /** @property {string} This command's description, as shown in :listcommands */ @@ -464,7 +464,7 @@ var CommandHive = Class("CommandHive", Contexts.Hive, { * Adds a new command to the builtin hive. Accessible only to core * dactyl code. Plugins should use group.commands.add instead. * - * @param {string[]} specs The names by which this command can be + * @param {[string]} specs The names by which this command can be * invoked. The first name specified is the command's canonical * name. * @param {string} description A description of the command. @@ -646,7 +646,7 @@ var Commands = Module("commands", { * * @param {string} filter Limits the list to those commands with a name * matching this anchored substring. - * @param {Hive[]} hives List of hives. + * @param {[Hive]} hives List of hives. * @optional */ list: function list(filter, hives) { diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 065da969..c22e05ce 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -105,7 +105,7 @@ var IO = Module("io", { * found it is sourced. Only the first file found (per specified path) is * sourced unless *all* is specified, then all found files are sourced. * - * @param {string[]} paths An array of relative paths to source. + * @param {[string]} paths An array of relative paths to source. * @param {boolean} all Whether all found files should be sourced. */ sourceFromRuntimePath: function sourceFromRuntimePath(paths, all) { @@ -423,7 +423,7 @@ var IO = Module("io", { * Runs an external program. * * @param {File|string} program The program to run. - * @param {string[]} args An array of arguments to pass to *program*. + * @param {[string]} args An array of arguments to pass to *program*. */ run: function (program, args, blocking) { args = args || []; diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm index c96a35dd..a3fb0592 100644 --- a/common/modules/javascript.jsm +++ b/common/modules/javascript.jsm @@ -665,9 +665,9 @@ var JavaScript = Module("javascript", { * time they are accessed, so they should be accessed * judiciously. * - * @param {function|function[]} funcs The functions for which to + * @param {function|[function]} funcs The functions for which to * install the completers. - * @param {function[]} completers An array of completer + * @param {[function]} completers An array of completer * functions. */ setCompleter: function (funcs, completers) { diff --git a/common/modules/options.jsm b/common/modules/options.jsm index a8e392ec..aaa6aba1 100644 --- a/common/modules/options.jsm +++ b/common/modules/options.jsm @@ -25,7 +25,7 @@ let ValueError = Class("ValueError", ErrorBase); * A class representing configuration options. Instances are created by the * {@link Options} class. * - * @param {string[]} names The names by which this option is identified. + * @param {[string]} names The names by which this option is identified. * @param {string} description A short one line description of the option. * @param {string} type The option's value data type (see {@link Option#type}). * @param {string} defaultValue The default value for this option. @@ -100,14 +100,14 @@ var Option = Class("Option", { * "charlist" or "stringlist" or else unchanged. * * @param {value} value The option value. - * @returns {value|string[]} + * @returns {value|[string]} */ parse: function parse(value) Option.dequote(value), /** * Returns *values* packed in the appropriate format for the option type. * - * @param {value|string[]} values The option value. + * @param {value|[string]} values The option value. * @returns {value} */ stringify: function stringify(vals) Commands.quote(vals), @@ -118,7 +118,7 @@ var Option = Class("Option", { * * @param {number} scope The scope to return these values from (see * {@link Option#scope}). - * @returns {value|string[]} + * @returns {value|[string]} */ get: function get(scope) { if (scope) { @@ -229,7 +229,7 @@ var Option = Class("Option", { * Sets the option's value using the specified set *operator*. * * @param {string} operator The set operator. - * @param {value|string[]} values The value (or values) to apply. + * @param {value|[string]} values The value (or values) to apply. * @param {number} scope The scope to apply this value to (see * {@link #scope}). * @param {boolean} invert Whether this is an invert boolean operation. @@ -258,7 +258,7 @@ var Option = Class("Option", { /** @property {string} The option's canonical name. */ name: null, - /** @property {string[]} All names by which this option is identified. */ + /** @property {[string]} All names by which this option is identified. */ names: null, /** @@ -675,7 +675,7 @@ var Option = Class("Option", { * Validates the specified *values* against values generated by the * option's completer function. * - * @param {value|string[]} values The value or array of values to validate. + * @param {value|[string]} values The value or array of values to validate. * @returns {boolean} */ validateCompleter: function validateCompleter(values) { @@ -825,7 +825,7 @@ var Options = Module("options", { /** * Adds a new option. * - * @param {string[]} names All names for the option. + * @param {[string]} names All names for the option. * @param {string} description A description of the option. * @param {string} type The option type (see {@link Option#type}). * @param {value} defaultValue The option's default value. diff --git a/common/modules/services.jsm b/common/modules/services.jsm index fb506166..1057bd72 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -125,7 +125,7 @@ var Services = Module("Services", { * * @param {string} name The service's cache key. * @param {string} class The class's contract ID. - * @param {string|string[]} ifaces The interface or array of + * @param {string|[string]} ifaces The interface or array of * interfaces implemented by this service. * @param {string} meth The name of the function used to instantiate * the service. @@ -143,7 +143,7 @@ var Services = Module("Services", { * * @param {string} name The class's cache key. * @param {string} class_ The class's contract ID. - * @param {nsISupports|nsISupports[]} ifaces The interface or array of + * @param {nsISupports|[nsISupports]} ifaces The interface or array of * interfaces implemented by this class. * @param {string} init Name of a property or method used to initialise the * class. See {@link #_create}. diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 89df265d..742e8a5b 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -363,7 +363,7 @@ var File = Class("File", { * * @param {boolean} sort Whether to sort the returned directory * entries. - * @returns {nsIFile[]} + * @returns {[nsIFile]} */ readDirectory: function (sort) { if (!this.isDirectory()) diff --git a/melodactyl/content/library.js b/melodactyl/content/library.js index be884741..95f16592 100644 --- a/melodactyl/content/library.js +++ b/melodactyl/content/library.js @@ -22,7 +22,7 @@ const Library = Module("library", { /** * Returns an array of all the artist names in the main library. * - * @returns {string[]} + * @returns {[string]} */ getArtists: function getArtists() this._toJSArray(this.MAIN_LIBRARY.getDistinctValuesForProperty(SBProperties.artistName)), @@ -32,7 +32,7 @@ const Library = Module("library", { * library. * * @param {string} artist The artist's name. - * @returns {string[]} + * @returns {[string]} */ getAlbums: function getAlbums(artist) { let albums = this._toJSArray(this.MAIN_LIBRARY.getItemsByProperty(SBProperties.artistName, artist)) @@ -46,7 +46,7 @@ const Library = Module("library", { * * @param {string} artist The artist's name. * @param {string} album The album's name. - * @returns {string[]} + * @returns {[string]} */ getTracks: function getTracks(artist, album) { let properties = services.MutablePropertyArray(); diff --git a/melodactyl/content/player.js b/melodactyl/content/player.js index 05355c90..f3b943ac 100644 --- a/melodactyl/content/player.js +++ b/melodactyl/content/player.js @@ -333,7 +333,7 @@ const Player = Module("player", { /** * Returns an array of all available playlists. * - * @returns {sbIMediaList[]} + * @returns {[sbIMediaList]} */ getPlaylists: function getPlaylists() { let mainLibrary = LibraryUtils.mainLibrary; @@ -367,7 +367,7 @@ const Player = Module("player", { /** * Returns an array of all available media pages. * - * @returns {sbIMediaPageInfo[]} + * @returns {[sbIMediaPageInfo]} */ getMediaPages: function getMediaPages() { let list = SBGetBrowser().currentMediaPage.mediaListView.mediaList; diff --git a/teledactyl/content/mail.js b/teledactyl/content/mail.js index 56531474..15b72005 100644 --- a/teledactyl/content/mail.js +++ b/teledactyl/content/mail.js @@ -129,7 +129,7 @@ const Mail = Module("mail", { get currentFolder() gFolderTreeView.getSelectedFolders()[0], - /** @property {nsISmtpServer[]} The list of configured SMTP servers. */ + /** @property {[nsISmtpServer]} The list of configured SMTP servers. */ get smtpServers() { let servers = services.smtp.smtpServers; let res = [];