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
+12 -12
View File
@@ -3,16 +3,16 @@ import _ol_render_webgl_texturereplay_defaultshader_ from '../../../../../src/ol
import _ol_render_webgl_texturereplay_defaultshader_Locations_ from '../../../../../src/ol/render/webgl/texturereplay/defaultshader/Locations.js';
describe('ol.render.webgl.TextureReplay', function() {
var replay;
let replay;
beforeEach(function() {
var tolerance = 0.1;
var maxExtent = [-10000, -20000, 10000, 20000];
const tolerance = 0.1;
const maxExtent = [-10000, -20000, 10000, 20000];
replay = new _ol_render_webgl_TextureReplay_(tolerance, maxExtent);
});
describe('#setUpProgram', function() {
var context, gl;
let context, gl;
beforeEach(function() {
context = {
getProgram: function() {},
@@ -29,9 +29,9 @@ describe('ol.render.webgl.TextureReplay', function() {
});
it('returns the locations used by the shaders', function() {
var locations = replay.setUpProgram(gl, context, [2, 2], 1);
const locations = replay.setUpProgram(gl, context, [2, 2], 1);
expect(locations).to.be.a(
_ol_render_webgl_texturereplay_defaultshader_Locations_);
_ol_render_webgl_texturereplay_defaultshader_Locations_);
});
it('gets and compiles the shaders', function() {
@@ -40,8 +40,8 @@ describe('ol.render.webgl.TextureReplay', function() {
replay.setUpProgram(gl, context, [2, 2], 1);
expect(context.getProgram.calledWithExactly(
_ol_render_webgl_texturereplay_defaultshader_.fragment,
_ol_render_webgl_texturereplay_defaultshader_.vertex)).to.be(true);
_ol_render_webgl_texturereplay_defaultshader_.fragment,
_ol_render_webgl_texturereplay_defaultshader_.vertex)).to.be(true);
expect(context.useProgram.calledOnce).to.be(true);
});
@@ -53,12 +53,12 @@ describe('ol.render.webgl.TextureReplay', function() {
replay.setUpProgram(gl, context, [2, 2], 1);
expect(gl.vertexAttribPointer.callCount).to.be(gl.getAttribLocation.callCount);
expect(gl.enableVertexAttribArray.callCount).to.be(
gl.getAttribLocation.callCount);
gl.getAttribLocation.callCount);
});
});
describe('#shutDownProgram', function() {
var context, gl;
let context, gl;
beforeEach(function() {
context = {
getProgram: function() {},
@@ -79,10 +79,10 @@ describe('ol.render.webgl.TextureReplay', function() {
sinon.spy(gl, 'getAttribLocation');
sinon.spy(gl, 'disableVertexAttribArray');
var locations = replay.setUpProgram(gl, context, [2, 2], 1);
const locations = replay.setUpProgram(gl, context, [2, 2], 1);
replay.shutDownProgram(gl, locations);
expect(gl.disableVertexAttribArray.callCount).to.be(
gl.getAttribLocation.callCount);
gl.getAttribLocation.callCount);
});
});
});