[internal] Replace var with let in root of ui

This change was applied only to files in the root of the src/ui
directory.

This was an automatic replacement from var to let for any variable
declaration that doubles as the initial assignment. Ultimately we want
most of these to be converted to const, but that can happen in a future
commit.

For example:

`var foo = 'bar';` becomes `let foo = 'var';`

This was accomplished by replacing:
find: `var ([a-zA-Z_$][0-9a-zA-Z_$]*)(\s+)=`
replace: `let $1$2=`
This commit is contained in:
Court Ewing 2016-04-12 17:50:00 -04:00
parent 2f3cdf67f4
commit a6ed127564
3 changed files with 9 additions and 9 deletions

View file

@ -48,9 +48,9 @@ class UiBundleCollection {
case 1:
return `bundle for ${this.each[0].id}`;
default:
var ids = this.getIds();
var last = ids.pop();
var commas = ids.join(', ');
let ids = this.getIds();
let last = ids.pop();
let commas = ids.join(', ');
return `bundles for ${commas} and ${last}`;
}
}

View file

@ -156,7 +156,7 @@ module.exports = class UiBundlerEnv {
let owner = pluginId ? `Plugin ${pluginId}` : 'Kibana Server';
// TODO(spalger): we could do a lot more to detect colliding module defs
var existingOwner = this.aliasOwners[id] || this.aliasOwners[`${id}$`];
let existingOwner = this.aliasOwners[id] || this.aliasOwners[`${id}$`];
if (existingOwner) {
throw new TypeError(`${owner} attempted to override export "${id}" from ${existingOwner}`);

View file

@ -19,10 +19,10 @@ class UiExports {
consumePlugin(plugin) {
plugin.apps = new UiAppCollection(this);
var types = _.keys(plugin.uiExportsSpecs);
let types = _.keys(plugin.uiExportsSpecs);
if (!types) return false;
var unkown = _.reject(types, this.exportConsumer, this);
let unkown = _.reject(types, this.exportConsumer, this);
if (unkown.length) {
throw new Error('unknown export types ' + unkown.join(', ') + ' in plugin ' + plugin.id);
}
@ -110,9 +110,9 @@ class UiExports {
}
find(patterns) {
var aliases = this.aliases;
var names = _.keys(aliases);
var matcher = _.partialRight(minimatch.filter, { matchBase: true });
let aliases = this.aliases;
let names = _.keys(aliases);
let matcher = _.partialRight(minimatch.filter, { matchBase: true });
return _.chain(patterns)
.map(function (pattern) {