Bug 1217922 - eslint head.js plugin does not seem to work r=pbrosset

--HG--
extra : commitid : 7lU7InBJixs
extra : rebase_source : df9d023a5e87aaa593d6fdbe96577765739641e6
extra : amend_source : 6158d4ffd46cf0fbf7f69ce9d4266279f5f29a10
This commit is contained in:
Michael Ratcliffe 2015-11-20 16:51:48 +00:00
Родитель 44786e5ba4
Коммит 5ac2b8706d
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -21,7 +21,7 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
function checkFile(fileArray, context) {
function checkFile(fileArray) {
var filePath = fileArray.pop();
while (filePath) {
@ -82,17 +82,17 @@ module.exports = function(context) {
//--------------------------------------------------------------------------
return {
Program: function(node) {
Program: function() {
if (!helpers.getIsBrowserMochitest(this)) {
return;
}
var pathAndFilename = this.getFilename();
var processPath = process.cwd();
var testFilename = path.basename(pathAndFilename);
var testPath = path.join(processPath, testFilename);
var headjs = path.join(processPath, "head.js");
checkFile([testPath, headjs], context);
var testPath = this.getFilename();
var testFilename = path.basename(testPath);
var fullTestPath = path.resolve(testFilename);
var fullHeadjsPath = path.resolve("head.js");
checkFile([fullTestPath, fullHeadjsPath]);
}
};
};