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

View File

@@ -7,7 +7,7 @@ import XYZ from '../../../../src/ol/source/XYZ.js';
where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
function afterRender(source, raster, callback) {
var loading = 0;
let loading = 0;
source.on('tileloadstart', function(event) {
loading++;
@@ -26,7 +26,7 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
}
var map;
let map;
function createMap(renderer, pixelRatio) {
map = new Map({
target: createMapDiv(200, 200),
@@ -50,17 +50,17 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
it('renders the result of an operation', function(done) {
createMap('canvas', 1);
var source = new XYZ({
const source = new XYZ({
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png',
transition: 0
});
var raster = new RasterSource({
const raster = new RasterSource({
sources: [source],
operation: function(pixels) {
var pixel = pixels[0];
const pixel = pixels[0];
// swap blue and red
var red = pixel[0];
const red = pixel[0];
pixel[0] = pixel[2];
pixel[2] = red;
return pixel;
@@ -75,7 +75,7 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
expectResemble(map, 'rendering/ol/source/expected/raster-1.png', IMAGE_TOLERANCE, done);
});
var layer = new ImageLayer({source: raster});
const layer = new ImageLayer({source: raster});
map.addLayer(layer);
});