mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-12 08:15:47 +01:00
Fix some stupid bugs in newer JägerMonkey. Closes issue #86.
This commit is contained in:
@@ -298,7 +298,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
if (!context)
|
if (!context)
|
||||||
context = userContext;
|
context = userContext;
|
||||||
context[EVAL_STRING] = str;
|
context[EVAL_STRING] = str;
|
||||||
return Cu.evalInSandbox("with (window) { eval(" + EVAL_STRING + ") }", context, "1.8", fileName, lineNumber);
|
return Cu.evalInSandbox("eval('with (window) {'+" + EVAL_STRING + "+'}')", context, "1.8", fileName, lineNumber);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ const IO = Module("io", {
|
|||||||
getRuntimeDirectories: function (name) {
|
getRuntimeDirectories: function (name) {
|
||||||
let dirs = options["runtimepath"];
|
let dirs = options["runtimepath"];
|
||||||
|
|
||||||
dirs = dirs.map(function (dir) File.joinPaths(dir, name, this.cwd))
|
dirs = dirs.map(function (dir) File.joinPaths(dir, name, this.cwd), this)
|
||||||
.filter(function (dir) dir.exists() && dir.isDirectory() && dir.isReadable());
|
.filter(function (dir) dir.exists() && dir.isDirectory() && dir.isReadable());
|
||||||
return dirs;
|
return dirs;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -147,11 +147,13 @@ const Highlights = Module("Highlight", {
|
|||||||
*
|
*
|
||||||
* @param {string} class
|
* @param {string} class
|
||||||
*/
|
*/
|
||||||
selector: function (class_)
|
selector: function (class_) {
|
||||||
class_.replace(/(^|\s)([A-Z]\w+)\b/g,
|
const self = this;
|
||||||
|
return class_.replace(/(^|\s)([A-Z]\w+)\b/g,
|
||||||
function (m, n1, hl) n1 +
|
function (m, n1, hl) n1 +
|
||||||
(this.highlight[hl] && this.highlight[hl].class != class_
|
(self.highlight[hl] && self.highlight[hl].class != class_
|
||||||
? this.highlight[hl] : "[dactyl|highlight~=" + hl + "]")),
|
? self.highlight[hl] : "[dactyl|highlight~=" + hl + "]"));
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears all highlighting rules. Rules with default values are
|
* Clears all highlighting rules. Rules with default values are
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ const File = Class("File", {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let self = XPCSafeJSObjectWrapper(file);
|
let self = XPCNativeWrapper(file);
|
||||||
self.__proto__ = File.prototype;
|
self.__proto__ = File.prototype;
|
||||||
return self;
|
return self;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user