Fix eslint warnings

This commit is contained in:
RainLoop Team 2016-04-20 20:12:51 +03:00
parent dd824179f1
commit 72ca818500
35 changed files with 510 additions and 290 deletions

View file

@ -30,6 +30,21 @@
Utils.isNull = _.isNull;
Utils.emptyFunction = Utils.noop = function () {};
/**
* @param {Function} callback
*/
Utils.silentTryCatch = function (callback)
{
try
{
callback();
}
catch (e)
{
// eslint-disable-line no-empty
}
};
/**
* @param {*} oValue
* @return {boolean}
@ -576,16 +591,17 @@
Utils.createCommand = function (oContext, fExecute, fCanExecute)
{
var
fResult = Utils.emptyFunction,
fNonEmpty = function () {
if (fResult && fResult.canExecute && fResult.canExecute())
{
fExecute.apply(oContext, Array.prototype.slice.call(arguments));
}
return false;
},
fResult = fExecute ? fNonEmpty : Utils.emptyFunction
}
;
fResult = fExecute ? fNonEmpty : Utils.emptyFunction;
fResult.enabled = ko.observable(true);
fCanExecute = Utils.isUnd(fCanExecute) ? true : fCanExecute;