mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-29 04:02:27 +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:
@@ -283,8 +283,11 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
|
||||
compileFormat: function compileFormat(format) {
|
||||
let stack = [frame()];
|
||||
stack.__defineGetter__("top", function () {
|
||||
return this[this.length - 1];
|
||||
Object.defineProperty(stack, "top", {
|
||||
get() {
|
||||
return this[this.length - 1];
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
|
||||
function frame() {
|
||||
@@ -370,8 +373,11 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
*/
|
||||
compileMacro: function compileMacro(macro, keepUnknown) {
|
||||
let stack = [frame()];
|
||||
stack.__defineGetter__("top", function () {
|
||||
return this[this.length - 1];
|
||||
Object.defineProperty(stack, "top", {
|
||||
get() {
|
||||
return this[this.length - 1];
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
let unknown = identity;
|
||||
|
||||
Reference in New Issue
Block a user