Use the classic function foo() { ... } for top level functions or functions that depend on the scope

This commit is contained in:
Juanjo Diaz
2018-07-09 22:48:22 +02:00
parent 651c23ece3
commit 885363a373
3 changed files with 10 additions and 11 deletions

View File

@@ -89,11 +89,11 @@ for (let i = 0; i < opt.argv.length; i++) {
const dom = new jsdom.JSDOM(file, { includeNodeLocations: true });
const body = dom.window.document.body;
const locator = (elem) => {
function locator(elem) {
const offset = dom.nodeLocation(elem).startOffset;
const line = file.slice(0, offset).split("\n").length;
return fn + ":" + line;
};
}
process(body, locator, true);
}