diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 21d6bae4..bd949eb2 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -484,7 +484,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { if (fileName && fileName[0] == "[") fileName = "dactyl://command-line/"; else if (!context) - context = ctxt || _userContext; + context = ctxt || userContext; if (isinstance(context, ["Sandbox"])) return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber); diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm index 42feea94..e90bb08d 100644 --- a/common/modules/contexts.jsm +++ b/common/modules/contexts.jsm @@ -138,8 +138,8 @@ var Contexts = Module("contexts", { completer: function (context) modules.completion.group(context) }); - memoize(modules, "userContext", () => contexts.Context(modules.io.getRCFile("~", true), contexts.user, [modules, true])); - memoize(modules, "_userContext", () => contexts.Context(modules.io.getRCFile("~", true), contexts.user, [modules.userContext])); + memoize(modules, "userContext", () => contexts.Context(modules.io.getRCFile("~", true), contexts.user, [modules, false])); + memoize(modules, "_userContext", () => modules.userContext); }, cleanup: function () { diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm index 686ffc3f..d1c3e37d 100644 --- a/common/modules/javascript.jsm +++ b/common/modules/javascript.jsm @@ -55,7 +55,7 @@ var JavaScript = Module("javascript", { lazyInit: true, - newContext: function () this.modules.newContext(this.modules.userContext, true, "Dactyl JS Temp Context"), + newContext: function () this.modules.newContext(this.modules.userContext, false, "Dactyl JS Temp Context"), completers: Class.Memoize(() => Object.create(JavaScript.completers)), diff --git a/common/modules/main.jsm b/common/modules/main.jsm index be394946..852b66d8 100644 --- a/common/modules/main.jsm +++ b/common/modules/main.jsm @@ -132,17 +132,15 @@ var Modules = function Modules(window) { if (normal) return create(proto); - if (services.has("dactyl") && services.dactyl.createGlobal) - var sandbox = services.dactyl.createGlobal(); - else - sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules, - sandboxName: name || ("Dactyl Sandbox " + ++_id), - wantXrays: false }); + sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules, + sandboxName: name || ("Dactyl Sandbox " + ++_id), + wantXrays: false }); // Hack: // sandbox.Object = jsmodules.Object; sandbox.File = jsmodules.File; sandbox.Math = jsmodules.Math; + sandbox.Set = jsmodules.Set; sandbox.__proto__ = proto || modules; return sandbox; },