Skip to content

Commit

Permalink
[internal] Remove all variable redeclarations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
epixa committed Apr 1, 2016
1 parent fc62113 commit de20762
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ui/public/agg_types/buckets/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/visualize/visualize_legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/scenario_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion test/functional/apps/discover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion test/functional/apps/visualize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ define(function (require) {

bdd.describe('visualize app', function () {
var common;
var scenarioManager;
var remote;
var headerPage;
var settingsPage;
Expand Down
2 changes: 1 addition & 1 deletion test/support/pages/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down

0 comments on commit de20762

Please sign in to comment.