js: Convert vars declared separately and assigned once to const.

Because of the separate declarations, ESLint would convert them to
`let` and then trigger the `prefer-const` error.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2019-10-25 15:11:05 -07:00
committed by Tim Abbott
parent c3b4c0a229
commit 4d37dfcf85
12 changed files with 18 additions and 39 deletions

View File

@@ -261,9 +261,8 @@ Filter.parse = function (str) {
return operators;
}
_.each(matches, function (token) {
var parts;
var operator;
parts = token.split(':');
const parts = token.split(':');
if (token[0] === '"' || parts.length === 1) {
// Looks like a normal search term.
search_term.push(token);
@@ -607,15 +606,13 @@ Filter.sorted_term_types = function (term_types) {
};
Filter.operator_to_prefix = function (operator, negated) {
var verb;
operator = Filter.canonicalize_operator(operator);
if (operator === 'search') {
return negated ? 'exclude' : 'search for';
}
verb = negated ? 'exclude ' : '';
const verb = negated ? 'exclude ' : '';
switch (operator) {
case 'stream':