utils/Abiword: use jshint

This commit is contained in:
booo 2011-12-22 13:32:36 +01:00
parent 11568b1278
commit 2a05f2d3df

View file

@ -52,18 +52,18 @@ if(os.type().indexOf("Windows") > -1)
//throw exceptions if abiword is dieing //throw exceptions if abiword is dieing
abiword.on('exit', function (code) abiword.on('exit', function (code)
{ {
if(code != 0) { if(code !== 0) {
throw "Abiword died with exit code " + code; throw "Abiword died with exit code " + code;
} }
if(stdoutBuffer != "") if(stdoutBuffer !== "")
{ {
console.log(stdoutBuffer); console.log(stdoutBuffer);
} }
callback(); callback();
}); });
} };
exports.convertFile = function(srcFile, destFile, type, callback) exports.convertFile = function(srcFile, destFile, type, callback)
{ {
@ -96,7 +96,7 @@ else
var stdoutBuffer = ""; var stdoutBuffer = "";
var firstPrompt = true; var firstPrompt = true;
function onAbiwordStdout(data) var onAbiwordStdout = function onAbiwordStdout(data)
{ {
//add data to buffer //add data to buffer
stdoutBuffer+=data.toString(); stdoutBuffer+=data.toString();
@ -112,7 +112,7 @@ else
//call the callback with the error message //call the callback with the error message
//skip the first prompt //skip the first prompt
if(stdoutCallback != null && !firstPrompt) if(stdoutCallback && !firstPrompt)
{ {
stdoutCallback(err); stdoutCallback(err);
stdoutCallback = null; stdoutCallback = null;
@ -120,7 +120,7 @@ else
firstPrompt = false; firstPrompt = false;
} }
} };
doConvertTask = function(task, callback) doConvertTask = function(task, callback)
{ {
@ -132,7 +132,7 @@ else
callback(); callback();
task.callback(err); task.callback(err);
}; };
} };
//Queue with the converts we have to do //Queue with the converts we have to do
var queue = async.queue(doConvertTask, 1); var queue = async.queue(doConvertTask, 1);