Allow empty string for detail/context in onError callback from rules.

This commit is contained in:
David Anson 2018-03-17 22:11:01 -07:00
parent b3f0d76a67
commit f80b61d8b7
3 changed files with 65 additions and 15 deletions

View file

@ -326,16 +326,12 @@ function lintContent(
!shared.isNumber(errorInfo.lineNumber)) {
throwError("lineNumber");
}
if ((errorInfo.detail !== null) &&
(errorInfo.detail !== undefined) &&
(!shared.isString(errorInfo.detail) ||
shared.isEmptyString(errorInfo.detail))) {
if (errorInfo.detail &&
!shared.isString(errorInfo.detail)) {
throwError("detail");
}
if ((errorInfo.context !== null) &&
(errorInfo.context !== undefined) &&
(!shared.isString(errorInfo.context) ||
shared.isEmptyString(errorInfo.context))) {
if (errorInfo.context &&
!shared.isString(errorInfo.context)) {
throwError("context");
}
if (errorInfo.range &&