Remove unused variables in geom
This commit is contained in:
@@ -12,6 +12,7 @@ describe('ol.geom.LinearRing', function() {
|
||||
it('throws when given mismatched dimension', function() {
|
||||
expect(function() {
|
||||
var ring = new ol.geom.LinearRing([[10, 20], [30, 40, 50]]);
|
||||
ring = ring; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('ol.geom.LineString', function() {
|
||||
it('throws when given mismatched dimension', function() {
|
||||
expect(function() {
|
||||
var line = new ol.geom.LineString([[10, 20], [30, 40, 50]]);
|
||||
line = line; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('ol.geom.MultiLineString', function() {
|
||||
it('throws when given with insufficient dimensions', function() {
|
||||
expect(function() {
|
||||
var multi = new ol.geom.MultiLineString([1]);
|
||||
multi = multi; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('ol.geom.MultiPoint', function() {
|
||||
it('throws when given with insufficient dimensions', function() {
|
||||
expect(function() {
|
||||
var multi = new ol.geom.MultiPoint([1]);
|
||||
multi = multi; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ describe('ol.geom.MultiPolygon', function() {
|
||||
it('throws when given with insufficient dimensions', function() {
|
||||
expect(function() {
|
||||
var multi = new ol.geom.MultiPolygon([1]);
|
||||
multi = multi; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ describe('ol.geom.Point', function() {
|
||||
it('throws when given with insufficient dimensions', function() {
|
||||
expect(function() {
|
||||
var point = new ol.geom.Point([1]);
|
||||
point = point; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ describe('ol.geom.Polygon', function() {
|
||||
it('throws when given mismatched dimension', function() {
|
||||
expect(function() {
|
||||
var poly = new ol.geom.Polygon([[[10, 20], [30, 40, 50]]]);
|
||||
poly = poly; // suppress gjslint warning about unused variable
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -117,9 +117,9 @@ describe('ol.geom.SharedVertices', function() {
|
||||
describe('#getCounts()', function() {
|
||||
it('returns the counts array', function() {
|
||||
var vertices = new ol.geom.SharedVertices();
|
||||
var first = vertices.add([[2, 3], [3, 4], [4, 5]]);
|
||||
var second = vertices.add([[5, 6], [6, 6]]);
|
||||
var third = vertices.add([[7, 8]]);
|
||||
vertices.add([[2, 3], [3, 4], [4, 5]]);
|
||||
vertices.add([[5, 6], [6, 6]]);
|
||||
vertices.add([[7, 8]]);
|
||||
|
||||
expect(vertices.getCounts()).to.eql([3, 2, 1]);
|
||||
});
|
||||
@@ -169,9 +169,9 @@ describe('ol.geom.SharedVertices', function() {
|
||||
describe('#getStarts()', function() {
|
||||
it('returns the counts array', function() {
|
||||
var vertices = new ol.geom.SharedVertices();
|
||||
var first = vertices.add([[2, 3], [3, 4], [4, 5]]);
|
||||
var second = vertices.add([[5, 6], [6, 6]]);
|
||||
var third = vertices.add([[7, 8]]);
|
||||
vertices.add([[2, 3], [3, 4], [4, 5]]);
|
||||
vertices.add([[5, 6], [6, 6]]);
|
||||
vertices.add([[7, 8]]);
|
||||
|
||||
expect(vertices.getStarts()).to.eql([0, 6, 10]);
|
||||
});
|
||||
@@ -180,19 +180,19 @@ describe('ol.geom.SharedVertices', function() {
|
||||
describe('#coordinates', function() {
|
||||
it('is a flat array of all coordinate values', function() {
|
||||
var vertices = new ol.geom.SharedVertices();
|
||||
var first = vertices.add([[1, 2], [3, 4]]);
|
||||
var second = vertices.add([[5, 6]]);
|
||||
var third = vertices.add([[7, 8], [9, 10], [11, 12]]);
|
||||
vertices.add([[1, 2], [3, 4]]);
|
||||
vertices.add([[5, 6]]);
|
||||
vertices.add([[7, 8], [9, 10], [11, 12]]);
|
||||
expect(vertices.coordinates).to.eql(
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
|
||||
});
|
||||
|
||||
it('is not reassigned', function() {
|
||||
var vertices = new ol.geom.SharedVertices();
|
||||
var first = vertices.add([[1, 2], [3, 4]]);
|
||||
vertices.add([[1, 2], [3, 4]]);
|
||||
var coordinates = vertices.coordinates;
|
||||
|
||||
var second = vertices.add([[5, 6]]);
|
||||
vertices.add([[5, 6]]);
|
||||
expect(vertices.coordinates).to.be(coordinates);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user