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
+9 -9
View File
@@ -1,7 +1,7 @@
/**
* @module ol/geom/flat/straightchunk
*/
var _ol_geom_flat_straightchunk_ = {};
const _ol_geom_flat_straightchunk_ = {};
/**
@@ -14,15 +14,15 @@ var _ol_geom_flat_straightchunk_ = {};
* given `flatCoordinates`.
*/
_ol_geom_flat_straightchunk_.lineString = function(maxAngle, flatCoordinates, offset, end, stride) {
var chunkStart = offset;
var chunkEnd = offset;
var chunkM = 0;
var m = 0;
var start = offset;
var acos, i, m12, m23, x1, y1, x12, y12, x23, y23;
let chunkStart = offset;
let chunkEnd = offset;
let chunkM = 0;
let m = 0;
let start = offset;
let acos, i, m12, m23, x1, y1, x12, y12, x23, y23;
for (i = offset; i < end; i += stride) {
var x2 = flatCoordinates[i];
var y2 = flatCoordinates[i + 1];
const x2 = flatCoordinates[i];
const y2 = flatCoordinates[i + 1];
if (x1 !== undefined) {
x23 = x2 - x1;
y23 = y2 - y1;