diff --git a/common/content/dactyl-overlay.js b/common/content/dactyl-overlay.js index df020682..93b054b1 100644 --- a/common/content/dactyl-overlay.js +++ b/common/content/dactyl-overlay.js @@ -7,8 +7,6 @@ (function () { function newContext(proto) { let sandbox = Components.utils.Sandbox(window); - if (jsmodules.__proto__ != window) - jsmodules.__proto__ = window; // Hack: sandbox.Object = jsmodules.Object; sandbox.Math = jsmodules.Math; diff --git a/common/content/dactyl.js b/common/content/dactyl.js index bbd1851a..804ab444 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -13,7 +13,7 @@ XML.ignoreWhitespace = false; XML.prettyPrinting = false; const plugins = { __proto__: modules }; -memoize(modules, "userContext", function () newContext(modules));; +const userContext = newContext(modules); const EVAL_ERROR = "__dactyl_eval_error"; const EVAL_RESULT = "__dactyl_eval_result"; @@ -1920,6 +1920,7 @@ const Dactyl = Module("dactyl", { }; }, load: function () { + jsmodules.__proto__ = window; dactyl.triggerObserver("load"); dactyl.log("All modules loaded", 3); diff --git a/common/content/javascript.js b/common/content/javascript.js index e9ef529d..c6c13078 100644 --- a/common/content/javascript.js +++ b/common/content/javascript.js @@ -536,7 +536,7 @@ const JavaScript = Module("javascript", { args.push(key + string); let compl = function (context, obj) { - let res = completer.call(this, context, funcName, obj, args); + let res = completer.call(self, context, funcName, obj, args); if (res) context.completions = res; };