1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-20 22:05:46 +01:00

Precompute completion string matching function.

This commit is contained in:
Kris Maglione
2010-09-17 06:15:13 -04:00
parent 8b0d9586b2
commit a5213c3760
14 changed files with 68 additions and 63 deletions

View File

@@ -842,7 +842,7 @@ const Dactyl = Module("dactyl", {
urls = [str];
return urls.map(function (url) {
if (/^[.~]?\//.test(url)) {
if (/^(\.{0,2}|~)\//.test(url)) {
try {
// Try to find a matching file.
let file = io.File(url);
@@ -906,14 +906,7 @@ const Dactyl = Module("dactyl", {
return func.apply(self || this, Array.slice(arguments, 2));
}
catch (e) {
if (e instanceof FailedAssertion) {
if (e.message)
dactyl.echoerr(e.message);
else
dactyl.beep();
}
else
dactyl.reportError(e);
dactyl.reportError(e);
return undefined;
}
},
@@ -925,6 +918,14 @@ const Dactyl = Module("dactyl", {
* @param {Object} error The error object.
*/
reportError: function (error) {
if (error instanceof FailedAssertion) {
if (error.message)
dactyl.echoerr(error.message);
else
dactyl.beep();
return;
}
if (Cu.reportError)
Cu.reportError(error);