diff options
Diffstat (limited to 'common/modules/contexts.jsm')
-rw-r--r-- | common/modules/contexts.jsm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm index 523033de..8d883a06 100644 --- a/common/modules/contexts.jsm +++ b/common/modules/contexts.jsm @@ -372,6 +372,7 @@ var Contexts = Module("contexts", { let rhs = args.literalArg; let type = ["-builtin", "-ex", "-javascript", "-keys"].reduce(function (a, b) args[b] ? b : a, default_); + switch (type) { case "-builtin": let noremap = true; @@ -385,6 +386,7 @@ var Contexts = Module("contexts", { } action.macro = util.compileMacro(rhs, true); break; + case "-ex": action = function action() modules.commands .execute(action.macro, makeParams(this, arguments), @@ -392,6 +394,7 @@ var Contexts = Module("contexts", { action.macro = util.compileMacro(rhs, true); action.context = this.context && update({}, this.context); break; + case "-javascript": if (callable(params)) action = dactyl.userEval("(function action() { with (action.makeParams(this, arguments)) {" + args.literalArg + "} })"); @@ -402,6 +405,7 @@ var Contexts = Module("contexts", { action.makeParams = makeParams; break; } + action.toString = function toString() (type === default_ ? "" : type + " ") + rhs; args = null; return action; |