Merge branch '12918-no-conditional-assignment'

This commit is contained in:
Torkel Ödegaard
2018-09-05 12:09:32 +02:00
11 changed files with 38 additions and 17 deletions

View File

@@ -218,9 +218,10 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
if (matches) {
const expressions = [];
const exprRegex = /, *([^,]+)/g;
let match;
while ((match = exprRegex.exec(matches[2])) !== null) {
let match = exprRegex.exec(matches[2]);
while (match !== null) {
expressions.push(match[1]);
match = exprRegex.exec(matches[2]);
}
options.limit = 10000;
return this.getTagValuesAutoComplete(expressions, matches[1], undefined, options);
@@ -233,9 +234,10 @@ export function GraphiteDatasource(this: any, instanceSettings, $q, backendSrv,
if (matches[1]) {
expressions.push(matches[1]);
const exprRegex = /, *([^,]+)/g;
let match;
while ((match = exprRegex.exec(matches[2])) !== null) {
let match = exprRegex.exec(matches[2]);
while (match !== null) {
expressions.push(match[1]);
match = exprRegex.exec(matches[2]);
}
}
options.limit = 10000;

View File

@@ -941,9 +941,10 @@ Lexer.prototype = {
tokenize: function() {
const list = [];
let token;
while ((token = this.next())) {
let token = this.next();
while (token) {
list.push(token);
token = this.next();
}
return list;
},