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

@@ -9,17 +9,17 @@ import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
describe('ol.rendering.reproj.Image', function() {
function testSingleImage(source, targetProj,
targetExtent, targetResolution, pixelRatio, expectedUrl, done) {
var sourceProj = source.getProjection();
targetExtent, targetResolution, pixelRatio, expectedUrl, done) {
const sourceProj = source.getProjection();
var imagesRequested = 0;
let imagesRequested = 0;
var image = new ReprojImage(sourceProj, getProjection(targetProj),
targetExtent, targetResolution, pixelRatio,
function(extent, resolution, pixelRatio) {
imagesRequested++;
return source.getImage(extent, resolution, pixelRatio, sourceProj);
});
const image = new ReprojImage(sourceProj, getProjection(targetProj),
targetExtent, targetResolution, pixelRatio,
function(extent, resolution, pixelRatio) {
imagesRequested++;
return source.getImage(extent, resolution, pixelRatio, sourceProj);
});
if (image.getState() == 0) { // IDLE
_ol_events_.listen(image, 'change', function(e) {
if (image.getState() == 2) { // LOADED
@@ -31,7 +31,7 @@ describe('ol.rendering.reproj.Image', function() {
}
}
var source;
let source;
describe('image reprojections from EPSG:3857', function() {
beforeEach(function() {
@@ -44,17 +44,17 @@ describe('ol.rendering.reproj.Image', function() {
it('works for identity reprojection', function(done) {
testSingleImage(source, 'EPSG:3857',
_ol_tilegrid_.createXYZ().getTileCoordExtent([5, 5, -13]),
2 * _ol_proj_EPSG3857_.HALF_SIZE / (256 * (1 << 5)), 1,
'rendering/ol/data/tiles/osm/5/5/12.png', done);
_ol_tilegrid_.createXYZ().getTileCoordExtent([5, 5, -13]),
2 * _ol_proj_EPSG3857_.HALF_SIZE / (256 * (1 << 5)), 1,
'rendering/ol/data/tiles/osm/5/5/12.png', done);
});
it('to EPSG:4326', function(done) {
testSingleImage(source, 'EPSG:4326',
_ol_tilegrid_.createForProjection('EPSG:4326').
getTileCoordExtent([6, 10, -10]),
360 / (256 * (1 << 4)), 1,
'rendering/ol/reproj/expected/image-3857-to-4326.png', done);
_ol_tilegrid_.createForProjection('EPSG:4326').
getTileCoordExtent([6, 10, -10]),
360 / (256 * (1 << 4)), 1,
'rendering/ol/reproj/expected/image-3857-to-4326.png', done);
});
});
});