1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 09:48:00 +01:00

Only call update() in (Command|Option|Map)#init if the extra config map was specified.

This commit is contained in:
Doug Kearns
2009-11-17 13:56:12 +11:00
parent 230490db05
commit cb7cff5766
3 changed files with 21 additions and 25 deletions

View File

@@ -39,21 +39,18 @@ const Command = Class("Command", {
init: function (specs, description, action, extraInfo) {
specs = Array.concat(specs); // XXX
let expandedSpecs = Command.parseSpecs(specs);
if (!extraInfo)
extraInfo = {};
let parsedSpecs = Command.parseSpecs(specs);
this.specs = specs;
this.shortNames = array(expandedSpecs).map(function (n) n[1]).compact();
this.longNames = expandedSpecs.map(function (n) n[0]);
this.shortNames = array(parsedSpecs).map(function (n) n[1]).compact();
this.longNames = parsedSpecs.map(function (n) n[0]);
this.name = this.longNames[0];
this.names = array(expandedSpecs).flatten();
this.names = array(parsedSpecs).flatten();
this.description = description;
this.action = action;
extraInfo.privateData = Boolean(extraInfo.privateData); // XXX
update(this, extraInfo);
if (extraInfo)
update(this, extraInfo);
},
/**