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