Просмотр исходного кода

dont shadow format passed in as function parameter

Sven Klemm 7 лет назад
Родитель
Сommit
764fa15e24
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      public/app/features/templating/template_srv.ts

+ 5 - 5
public/app/features/templating/template_srv.ts

@@ -179,16 +179,16 @@ export class TemplateSrv {
       return target;
     }
 
-    var variable, systemValue, value;
+    var variable, systemValue, value, fmt;
     this.regex.lastIndex = 0;
 
     return target.replace(this.regex, (match, var1, var2, fmt2, var3, fmt3) => {
       variable = this.index[var1 || var2 || var3];
-      format = fmt2 || fmt3 || format;
+      fmt = fmt2 || fmt3 || format;
       if (scopedVars) {
         value = scopedVars[var1 || var2 || var3];
         if (value) {
-          return this.formatValue(value.value, format, variable);
+          return this.formatValue(value.value, fmt, variable);
         }
       }
 
@@ -198,7 +198,7 @@ export class TemplateSrv {
 
       systemValue = this.grafanaVariables[variable.current.value];
       if (systemValue) {
-        return this.formatValue(systemValue, format, variable);
+        return this.formatValue(systemValue, fmt, variable);
       }
 
       value = variable.current.value;
@@ -210,7 +210,7 @@ export class TemplateSrv {
         }
       }
 
-      var res = this.formatValue(value, format, variable);
+      var res = this.formatValue(value, fmt, variable);
       return res;
     });
   }