From 2ba1a6ec5c52476e862048bbbff772a5d2022533 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 16 Feb 2014 21:21:28 -0800 Subject: [PATCH] Remove more cruft. --- common/content/dactyl.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 6731fc34..ab2bfcf7 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -460,12 +460,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }, userEval: function userEval(str, context, fileName, lineNumber) { - let ctxt; - if (jsmodules.__proto__ != window && jsmodules.__proto__ != XPCNativeWrapper(window) && - jsmodules.isPrototypeOf(context)) - str = "with (window) { with (modules) { (this.eval || eval)(" + str.quote() + ") } }"; + let ctxt, + info = contexts.context; - let info = contexts.context; if (fileName == null) if (info) ({ file: fileName, line: lineNumber, context: ctxt }) = info; @@ -475,12 +472,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { else if (!context) context = ctxt || userContext; - if (isinstance(context, ["Sandbox"])) - return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); - if (!context) context = userContext || ctxt; + if (isinstance(context, ["Sandbox"])) + return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); + if (services.has("dactyl") && services.dactyl.evalInContext) return services.dactyl.evalInContext(str, context, fileName, lineNumber);