1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-29 11:22:27 +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) {
if ("default" in opt)
Object.defineProperty(res, opt.names[0],
Object.getOwnPropertyDescriptor(opt, "default") ||
{ configurable: true, enumerable: true, get: function () opt.default });
if (opt.default !== undefined) {
let prop = Object.getOwnPropertyDescriptor(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;