1
0
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:
Doug Kearns
2015-07-23 01:55:32 +10:00
parent c035aa936b
commit 77d59cdfd1
45 changed files with 1595 additions and 1045 deletions

View File

@@ -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";
}
};
}