mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 03:57:59 +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) {
|
if (textBox) {
|
||||||
textBox.value = val;
|
textBox.value = val;
|
||||||
|
|
||||||
if (false) {
|
if (true) {
|
||||||
let elem = DOM(textBox);
|
let elem = DOM(textBox);
|
||||||
elem.attrNS(NS, "modifiable", true)
|
elem.attrNS(NS, "modifiable", true)
|
||||||
.style.MozUserInput;
|
.style.MozUserInput;
|
||||||
|
|||||||
@@ -222,7 +222,10 @@ var Contexts = Module("contexts", {
|
|||||||
util.trapErrors("onUnload", self);
|
util.trapErrors("onUnload", self);
|
||||||
}
|
}
|
||||||
else {
|
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, {
|
update(self, {
|
||||||
NAME: Const(id),
|
NAME: Const(id),
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ var JavaScript = Module("javascript", {
|
|||||||
|
|
||||||
lazyInit: true,
|
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)),
|
completers: Class.Memoize(function () Object.create(JavaScript.completers)),
|
||||||
|
|
||||||
@@ -765,10 +765,10 @@ var JavaScript = Module("javascript", {
|
|||||||
let self = this;
|
let self = this;
|
||||||
let sandbox = true || isinstance(context, ["Sandbox"]);
|
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 = modules.JavaScript();
|
||||||
this.js.replContext = this.context;
|
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.js.globals = [
|
||||||
[this.context, /*L*/"REPL Variables"],
|
[this.context, /*L*/"REPL Variables"],
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ var ModuleBase = Class("ModuleBase", {
|
|||||||
toString: function () "[module " + this.constructor.className + "]"
|
toString: function () "[module " + this.constructor.className + "]"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var _id = 0;
|
||||||
|
|
||||||
var Modules = function Modules(window) {
|
var Modules = function Modules(window) {
|
||||||
/**
|
/**
|
||||||
* @constructor Module
|
* @constructor Module
|
||||||
@@ -136,7 +138,7 @@ var Modules = function Modules(window) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
newContext: function newContext(proto, normal) {
|
newContext: function newContext(proto, normal, name) {
|
||||||
if (normal)
|
if (normal)
|
||||||
return create(proto);
|
return create(proto);
|
||||||
|
|
||||||
@@ -144,6 +146,7 @@ var Modules = function Modules(window) {
|
|||||||
var sandbox = services.dactyl.createGlobal();
|
var sandbox = services.dactyl.createGlobal();
|
||||||
else
|
else
|
||||||
sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules,
|
sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules,
|
||||||
|
sandboxName: name || ("Dactyl Sandbox " + ++_id),
|
||||||
wantXrays: false });
|
wantXrays: false });
|
||||||
|
|
||||||
// Hack:
|
// Hack:
|
||||||
|
|||||||
Reference in New Issue
Block a user