1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-23 09:45:47 +01:00

Replace expression closures (function expressions - named and dynamic this).

Expression closures are to be axed. See https://bugzil.la/1083458.

Leaving deprecated() and literal() calls and method shorthand syntax
conversions until after the ESR overlap.
This commit is contained in:
Doug Kearns
2015-06-06 23:12:40 +10:00
parent 07b64b3197
commit b236add69d
43 changed files with 876 additions and 520 deletions

View File

@@ -16,8 +16,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
init: function () {
window.dactyl = this;
// cheap attempt at compatibility
let prop = { get: deprecated("dactyl", function liberator() dactyl),
configurable: true };
let prop = {
get: deprecated("dactyl", function liberator() { return dactyl; }),
configurable: true
};
Object.defineProperty(window, "liberator", prop);
Object.defineProperty(modules, "liberator", prop);
this.commands = {};
@@ -255,7 +257,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
argCount: "*",
completer: function (context, args) {
context.keys.text = util.identity;
context.keys.description = function () seen[this.text] + /*L*/" matching items";
context.keys.description = function () {
return seen[this.text] + /*L*/" matching items";
};
context.ignoreCase = true;
let seen = {};
context.completions = Ary(keys(item).join(" ").toLowerCase().split(/[()\s]+/)