mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 00:38:00 +01:00
Cause some crashes, no doubt.
--HG-- extra : rebase_source : db7b09141e561645cd40b970c2a5e4921c2f39c0
This commit is contained in:
@@ -455,7 +455,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
if (textBox) {
|
||||
textBox.value = val;
|
||||
|
||||
if (false) {
|
||||
if (true) {
|
||||
let elem = DOM(textBox);
|
||||
elem.attrNS(NS, "modifiable", true)
|
||||
.style.MozUserInput;
|
||||
|
||||
@@ -222,7 +222,10 @@ var Contexts = Module("contexts", {
|
||||
util.trapErrors("onUnload", self);
|
||||
}
|
||||
else {
|
||||
self = args && !isArray(args) ? args : newContext.apply(null, args || [userContext]);
|
||||
let params = Array.slice(args || [userContext]);
|
||||
params[2] = params[2] || File(file).URI.spec;
|
||||
|
||||
self = args && !isArray(args) ? args : newContext.apply(null, params);
|
||||
update(self, {
|
||||
NAME: Const(id),
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ var JavaScript = Module("javascript", {
|
||||
|
||||
lazyInit: true,
|
||||
|
||||
newContext: function () this.modules.newContext(this.modules.userContext, true),
|
||||
newContext: function () this.modules.newContext(this.modules.userContext, true, "Dactyl JS Temp Context"),
|
||||
|
||||
completers: Class.Memoize(function () Object.create(JavaScript.completers)),
|
||||
|
||||
@@ -765,10 +765,10 @@ var JavaScript = Module("javascript", {
|
||||
let self = this;
|
||||
let sandbox = true || isinstance(context, ["Sandbox"]);
|
||||
|
||||
this.context = modules.newContext(context, !sandbox);
|
||||
this.context = modules.newContext(context, !sandbox, "Dactyl REPL Context");
|
||||
this.js = modules.JavaScript();
|
||||
this.js.replContext = this.context;
|
||||
this.js.newContext = function newContext() modules.newContext(self.context, !sandbox);
|
||||
this.js.newContext = function newContext() modules.newContext(self.context, !sandbox, "Dactyl REPL Temp Context");
|
||||
|
||||
this.js.globals = [
|
||||
[this.context, /*L*/"REPL Variables"],
|
||||
|
||||
@@ -28,6 +28,8 @@ var ModuleBase = Class("ModuleBase", {
|
||||
toString: function () "[module " + this.constructor.className + "]"
|
||||
});
|
||||
|
||||
var _id = 0;
|
||||
|
||||
var Modules = function Modules(window) {
|
||||
/**
|
||||
* @constructor Module
|
||||
@@ -136,7 +138,7 @@ var Modules = function Modules(window) {
|
||||
}
|
||||
},
|
||||
|
||||
newContext: function newContext(proto, normal) {
|
||||
newContext: function newContext(proto, normal, name) {
|
||||
if (normal)
|
||||
return create(proto);
|
||||
|
||||
@@ -144,6 +146,7 @@ var Modules = function Modules(window) {
|
||||
var sandbox = services.dactyl.createGlobal();
|
||||
else
|
||||
sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules,
|
||||
sandboxName: name || ("Dactyl Sandbox " + ++_id),
|
||||
wantXrays: false });
|
||||
|
||||
// Hack:
|
||||
|
||||
Reference in New Issue
Block a user