1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-29 08:02:25 +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:
Zheng Chaoping
2016-05-04 20:00:59 +08:00
parent 1a4290d92a
commit 195ea78efb
20 changed files with 291 additions and 146 deletions

View File

@@ -160,7 +160,7 @@ var Services = Module("Services", {
add: function add(name, class_, ifaces, meth) {
const self = this;
this.services[name] = { method: meth, class: class_, interfaces: Array.concat(ifaces || []) };
if (name in this && ifaces && !this.__lookupGetter__(name) && !(this[name] instanceof Ci.nsISupports))
if (name in this && ifaces && !Object.getOwnPropertyDescriptor(this, name).get && !(this[name] instanceof Ci.nsISupports))
throw TypeError();
memoize(this, name, () => self._create(name));
},