1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 07:12:28 +01:00

Use evalInSandbox for :js rather than the subscript loader so that we can preserve file names/line numbers.

This commit is contained in:
Kris Maglione
2010-10-04 21:33:39 -04:00
parent a21c2510e3
commit 2012279ad9
10 changed files with 46 additions and 53 deletions

View File

@@ -9,7 +9,7 @@
/** @scope modules */
plugins.contexts = {};
plugins.contexts = plugins;
function Script(file) {
let self = plugins[file.path];
if (self) {
@@ -19,11 +19,10 @@ function Script(file) {
}
else
self = { __proto__: plugins };
plugins.contexts[file.path] = self;
plugins[file.path] = self;
self.NAME = file.leafName.replace(/\..*/, "").replace(/-([a-z])/g, function (m, n1) n1.toUpperCase());
self.PATH = file.path;
self.__context__ = self;
self.CONTEXT = self;
// This belongs elsewhere
if (io.getRuntimeDirectories("plugins").some(
@@ -366,6 +365,7 @@ lookup:
this.readHeredoc = function (end) {
let res = [];
try {
io.sourcing.line++;
while (true)
let ([i, line] = iter.next()) {
if (line === end)