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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user