refactor: remove redundant contextDescription empty check (#11219)

This commit is contained in:
Huáng Jùnliàng 2020-03-05 16:17:01 -05:00 committed by GitHub
parent 8cafd8f820
commit e297e406ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -457,24 +457,13 @@ export default class LValParser extends NodeUtils {
break;
default: {
if (contextDescription) {
this.raise(
expr.start,
bindingType === BIND_NONE
? Errors.InvalidLhs
: Errors.InvalidLhsBinding,
contextDescription,
);
} else {
// todo: check if contextDescription is never empty
const message =
(bindingType === BIND_NONE
? "Invalid"
: /* istanbul ignore next */ "Binding invalid") +
" left-hand side expression";
this.raise(expr.start, message);
}
this.raise(
expr.start,
bindingType === BIND_NONE
? Errors.InvalidLhs
: Errors.InvalidLhsBinding,
contextDescription,
);
}
}
}