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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user