[internal] Remove all variable redeclarations

Redeclaring variables causes ambiguity and serves no purpose. It
actually causes a runtime error when you do it with `let`, and we can
enforce not doing it via a linter rule.
This commit is contained in:
Court Ewing 2016-04-01 14:21:55 -04:00
parent fc62113d72
commit de20762889
6 changed files with 3 additions and 6 deletions

View file

@ -30,7 +30,7 @@ export default function RangeAggDefinition(Private) {
var id = RangeKey.idBucket(bucket);
var key = keys.get(id);
key = keys.get(id);
if (!key) {
key = new RangeKey(bucket);
keys.set(id, key);

View file

@ -90,7 +90,7 @@ uiModules.get('kibana')
// Most of these functions were moved directly from the old Legend class. Not a fan of this.
function getLabels(data, type) {
if (!data) return [];
var data = data.columns || data.rows || [data];
data = data.columns || data.rows || [data];
if (type === 'pie') return Data.prototype.pieNames(data);
return getSeriesLabels(data);
};

View file

@ -123,7 +123,6 @@ ScenarioManager.prototype.loadIfEmpty = function (id) {
var scenario = config[id];
if (!scenario) throw new Error('No scenario found for ' + id);
var self = this;
return Promise.all(scenario.bulk.map(function mapBulk(bulk) {
var loadIndexDefinition;

View file

@ -9,7 +9,6 @@ define(function (require) {
var collapseExpand = require('./_collapse_expand');
bdd.describe('discover app', function () {
var scenarioManager;
var remote;
var scenarioManager = new ScenarioManager(url.format(config.servers.elasticsearch));
this.timeout = config.timeouts.default;

View file

@ -20,7 +20,6 @@ define(function (require) {
bdd.describe('visualize app', function () {
var common;
var scenarioManager;
var remote;
var headerPage;
var settingsPage;

View file

@ -91,7 +91,7 @@ define(function (require) {
return self.remote.getCurrentUrl();
})
.then(function (currentUrl) {
var currentUrl = currentUrl.replace(/\/\/\w+:\w+@/, '//');
currentUrl = currentUrl.replace(/\/\/\w+:\w+@/, '//');
var navSuccessful = new RegExp(appUrl).test(currentUrl);
if (!navSuccessful) {
var msg = 'App failed to load: ' + appName +