mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 22:07:58 +01:00
Use Object.defineProperty instead of __defineGetter__/__defineSetter__
In Firefox 48+, the __defineSetter__/__defineSetter__ is deprecated, so use Object.defineProperty instead.
This commit is contained in:
@@ -62,9 +62,13 @@ let init = function init_() {
|
||||
UserAgent = Struct("name", "useragent", "appname", "appcodename",
|
||||
"appversion", "platform", "vendor", "vendorsub", "userset");
|
||||
|
||||
UserAgent.prototype.__defineGetter__("options", function () {
|
||||
return opts.slice(1).map(opt => [opt.name, this[opt.name]])
|
||||
.filter(opt => opt[1]);
|
||||
Object.defineProperty(UserAgent.prototype, "options", {
|
||||
get() {
|
||||
return opts.slice(1).map(opt => [opt.name, this[opt.name]])
|
||||
.filter(opt => opt[1]);
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
useragents = array([
|
||||
|
||||
Reference in New Issue
Block a user