Validation should return undefined in case of async validations

This commit is contained in:
Anatoliy Chakkaev 2011-11-26 15:22:36 +07:00
parent 66e311f8a0
commit 76a2f9a22c
1 changed files with 5 additions and 3 deletions

View File

@ -143,11 +143,13 @@ Validatable.prototype.isValid = function (callback) {
if (!async) {
if (valid) cleanErrors(this);
if (callback) callback(valid);
return valid;
} else {
// in case of async validation we should return undefined here,
// because not all validations are finished yet
return;
}
return valid;
};
function cleanErrors(inst) {