1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-05 13:24:18 +01:00

Some minor fixes, and add ctypes support to iter().

--HG--
branch : mode-refactoring
This commit is contained in:
Kris Maglione
2010-10-07 23:18:09 -04:00
parent 76e331afea
commit 248c906e9c
4 changed files with 45 additions and 23 deletions

View File

@@ -25,16 +25,16 @@ const FailedAssertion = Class("FailedAssertion", Error, {
}
});
deprecated.seen = { "chrome://dactyl/content/javascript.js": true };
function deprecated(reason, fn)
function deprecated(reason, fn) update(
function deprecatedMethod() {
let frame = Components.stack.caller;
if (!set.add(deprecated.seen, frame.filename))
if (!set.add(deprecatedMethod.seen, frame.filename))
dactyl.echoerr(frame.filename + ":" + frame.lineNumber + ": " +
(this.className || this.constructor.className) + "." + fn.name +
" is deprecated: " + reason);
return fn.apply(this, arguments);
}
},
{ seen: { "chrome://dactyl/content/javascript.js": true } });
const Dactyl = Module("dactyl", {
init: function () {

View File

@@ -345,13 +345,15 @@ lookup:
dactyl.helpInitialized = false;
}
catch (e) {
if (isString(e))
e = { message: e };
let err = new Error();
for (let [k, v] in Iterator(e))
err[k] = v;
err.echoerr = <>{file.path}:{e.lineNumber}: {e}</>;
throw err;
if (e.fileName)
try {
e.fileName = e.fileName.replace(/^(chrome|resource):.*? -> /, "");
if (e.fileName == uri.spec)
e.fileName = filename;
e.echoerr = <>{e.fileName}:{e.lineNumber}: {e}</>
}
catch (e) {}
throw e;
}
}
else if (/\.css$/.test(filename))

View File

@@ -358,8 +358,6 @@ const JavaScript = Module("javascript", {
}
let args = {
completer: compl,
anchored: true,
filter: last == null ? key : string,
last: last,
prefix: last != null ? key : ""
@@ -369,39 +367,42 @@ const JavaScript = Module("javascript", {
// TODO: Make this a generic completion helper function.
for (let [, obj] in Iterator(objects))
this.context.fork(obj[1], this._top.offset, this, this._fill,
update({}, args, {
update({
obj: obj[0],
name: obj[1]
}));
name: obj[1],
anchored: true,
completer: compl
}, args));
if (orig)
return;
for (let [, obj] in Iterator(objects))
this.context.fork(obj[1] + "/prototypes", this._top.offset, this, this._fill,
update({}, args, {
update({
obj: obj[0],
name: obj[1] + " (prototypes)",
anchored: true,
completer: function (a, b) compl(a, b, true)
}));
}, args));
for (let [, obj] in Iterator(objects))
this.context.fork(obj[1] + "/substrings", this._top.offset, this, this._fill,
update({}, args, {
update({
obj: obj[0],
name: obj[1] + " (substrings)",
anchored: false,
completer: compl
}));
}, args));
for (let [, obj] in Iterator(objects))
this.context.fork(obj[1] + "/prototypes/substrings", this._top.offset, this, this._fill,
update({}, args, {
update({
obj: obj[0],
name: obj[1] + " (prototype substrings)",
anchored: false,
completer: function (a, b) compl(a, b, true)
}));
}, args));
},
_getKey: function () {