1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 10:18:00 +01:00

Add function arg completion to javascript completion. Better exceptions from liberator.eval.

This commit is contained in:
Kris Maglione
2008-10-08 23:43:17 +00:00
parent 1018759953
commit b350867a7e
2 changed files with 163 additions and 84 deletions

View File

@@ -638,7 +638,22 @@ const liberator = (function () //{{{
// with (liberator) means, liberator is the default namespace "inside" eval
eval: function (str)
{
return eval("with (liberator) {" + str + "}");
const fileName = "chrome://" + liberator.config.name.toLowerCase() + "/content/liberator.js";
const line = new Error().lineNumber + 3;
try
{
return eval("with (liberator) {" + str + "}");
}
catch (e)
{
if (e.fileName == fileName && e.lineNumber >= line)
{
e.source = str;
e.fileName = "<Evaled string>";
e.lineNumber -= line;
}
throw e;
}
},
// Execute an Ex command like str=":zoom 300"