1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-05 10:35:47 +01:00

Fix issue with crufty old mapping aliases.

This commit is contained in:
Kris Maglione
2011-10-07 07:07:49 -04:00
parent 631b309fad
commit 3126683b46

View File

@@ -328,10 +328,14 @@ var Command = Class("Command", {
}); });
this.options.forEach(function (opt) { this.options.forEach(function (opt) {
if ("default" in opt) if (opt.default !== undefined) {
Object.defineProperty(res, opt.names[0], let prop = Object.getOwnPropertyDescriptor(opt, "default") ||
Object.getOwnPropertyDescriptor(opt, "default") || { configurable: true, enumerable: true, get: function () opt.default };
{ configurable: true, enumerable: true, get: function () opt.default });
if (prop.get && !prop.set)
prop.set = function (val) { Class.replaceProperty(this, opt.names[0], val) };
Object.defineProperty(res, opt.names[0], prop);
}
}); });
return res; return res;