summaryrefslogtreecommitdiff
path: root/common/modules/contexts.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-05-31 17:34:47 -0400
committerKris Maglione <maglione.k@gmail.com>2011-05-31 17:34:47 -0400
commit7d019560be3782ddb3e31e0602bd014e7bc0e88d (patch)
treead7c750ca3846719e5738f1abbd8760aa3d0e44f /common/modules/contexts.jsm
parent1632e5d594e2d3a10237b90cc087af3b92cf82af (diff)
downloadpentadactyl-7d019560be3782ddb3e31e0602bd014e7bc0e88d.tar.gz
Fix Firefox freakout. Closes issue #463.
Diffstat (limited to 'common/modules/contexts.jsm')
-rw-r--r--common/modules/contexts.jsm4
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;