Use blocked scoped variables

In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
This commit is contained in:
Tim Schaub
2018-01-11 23:32:36 -07:00
parent 0bf2b04dee
commit ad62739a6e
684 changed files with 18120 additions and 18184 deletions
+5 -5
View File
@@ -11,7 +11,7 @@ import _ol_tilecoord_ from './tilecoord.js';
* @param {number=} opt_highWaterMark High water mark.
* @struct
*/
var TileCache = function(opt_highWaterMark) {
const TileCache = function(opt_highWaterMark) {
LRUCache.call(this, opt_highWaterMark);
@@ -24,7 +24,7 @@ inherits(TileCache, LRUCache);
* @param {Object.<string, ol.TileRange>} usedTiles Used tiles.
*/
TileCache.prototype.expireCache = function(usedTiles) {
var tile, zKey;
let tile, zKey;
while (this.canExpireCache()) {
tile = this.peekLast();
zKey = tile.tileCoord[0].toString();
@@ -44,9 +44,9 @@ TileCache.prototype.pruneExceptNewestZ = function() {
if (this.getCount() === 0) {
return;
}
var key = this.peekFirstKey();
var tileCoord = _ol_tilecoord_.fromKey(key);
var z = tileCoord[0];
const key = this.peekFirstKey();
const tileCoord = _ol_tilecoord_.fromKey(key);
const z = tileCoord[0];
this.forEach(function(tile) {
if (tile.tileCoord[0] !== z) {
this.remove(_ol_tilecoord_.getKey(tile.tileCoord));