mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 21:12:27 +01:00
Replace expression closures (methods).
Expression closures are to be axed. See https://bugzil.la/1083458.
This commit is contained in:
@@ -51,7 +51,10 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
||||
|
||||
uri = isObject(uri) ? uri : util.newURI(uri || doc.location.href);
|
||||
let args = {
|
||||
url: { toString: function () uri.spec, valueOf: function () uri },
|
||||
url: {
|
||||
toString: function () { return uri.spec; },
|
||||
valueOf: function () { return uri; }
|
||||
},
|
||||
title: doc.title
|
||||
};
|
||||
|
||||
@@ -60,12 +63,16 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
||||
else {
|
||||
args.tab = tabs.getContentIndex(doc) + 1;
|
||||
args.doc = {
|
||||
valueOf: function () doc,
|
||||
toString: function () "tabs.getTab(" + (args.tab - 1) + ").linkedBrowser.contentDocument"
|
||||
valueOf: function () { return doc; },
|
||||
toString: function () {
|
||||
return "tabs.getTab(" + (args.tab - 1) + ").linkedBrowser.contentDocument";
|
||||
}
|
||||
};
|
||||
args.win = {
|
||||
valueOf: function () doc.defaultView,
|
||||
toString: function () "tabs.getTab(" + (args.tab - 1) + ").linkedBrowser.contentWindow"
|
||||
valueOf: function () { return doc.defaultView; },
|
||||
toString: function () {
|
||||
return "tabs.getTab(" + (args.tab - 1) + ").linkedBrowser.contentWindow";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user