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
+7 -7
View File
@@ -1,7 +1,7 @@
import _ol_render_webgl_Replay_ from '../../../../../src/ol/render/webgl/Replay.js';
describe('ol.render.Replay', function() {
var replay;
let replay;
beforeEach(function() {
replay = new _ol_render_webgl_Replay_(5, [-180, -90, 180, 90]);
});
@@ -15,8 +15,8 @@ describe('ol.render.Replay', function() {
});
it ('sets up the required matrices', function() {
var mat3 = [1, 0, 0, 1, 0, 0];
var mat4 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
const mat3 = [1, 0, 0, 1, 0, 0];
const mat4 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
expect(replay.projectionMatrix_).to.eql(mat3);
expect(replay.offsetRotateMatrix_).to.eql(mat3);
expect(replay.offsetScaleMatrix_).to.eql(mat3);
@@ -25,11 +25,11 @@ describe('ol.render.Replay', function() {
});
describe('#replay', function() {
var gl = {
const gl = {
uniformMatrix4fv: function() {},
uniform1f: function() {}
};
var context = {
const context = {
bindBuffer: function() {},
getGL: function() {
return gl;
@@ -47,9 +47,9 @@ describe('ol.render.Replay', function() {
});
it('calculates the correct matrices', function() {
var sin = Math.sin(Math.PI);
const sin = Math.sin(Math.PI);
replay.replay(context, [0, 0], 10, Math.PI, [10, 10], 1, 0, {}, undefined,
false, undefined);
false, undefined);
expect(replay.projectionMatrix_).to.eql([-0.02, -sin * 0.02, sin * 0.02,
-0.02, 0, 0]);