From b021bfd70f9ce5e5cac4b78bf296ed7c96da679c Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 21 May 2013 12:47:14 +0200 Subject: [PATCH] Remove unused variables in geom --- src/ol/geom/polygon.js | 7 ------- test/spec/ol/geom/linearring.test.js | 1 + test/spec/ol/geom/linestring.test.js | 1 + test/spec/ol/geom/multilinestring.test.js | 1 + test/spec/ol/geom/multipoint.test.js | 1 + test/spec/ol/geom/multipolygon.test.js | 1 + test/spec/ol/geom/point.test.js | 1 + test/spec/ol/geom/polygon.test.js | 1 + test/spec/ol/geom/sharedvertices.test.js | 22 +++++++++++----------- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index 7da4f2a82a..e9b6d7c600 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -1,7 +1,6 @@ goog.provide('ol.geom.Polygon'); goog.require('goog.asserts'); -goog.require('ol.Extent'); goog.require('ol.geom.Geometry'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.LinearRing'); @@ -51,12 +50,6 @@ ol.geom.Polygon = function(coordinates, opt_shared) { this.dimension = vertices.getDimension(); goog.asserts.assert(this.dimension >= 2); - /** - * @type {ol.Extent} - * @private - */ - this.bounds_ = null; - }; goog.inherits(ol.geom.Polygon, ol.geom.Geometry); diff --git a/test/spec/ol/geom/linearring.test.js b/test/spec/ol/geom/linearring.test.js index 118b076f36..67b1da9935 100644 --- a/test/spec/ol/geom/linearring.test.js +++ b/test/spec/ol/geom/linearring.test.js @@ -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(); }); diff --git a/test/spec/ol/geom/linestring.test.js b/test/spec/ol/geom/linestring.test.js index 22e7c16d84..dfdd1c37ee 100644 --- a/test/spec/ol/geom/linestring.test.js +++ b/test/spec/ol/geom/linestring.test.js @@ -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(); }); diff --git a/test/spec/ol/geom/multilinestring.test.js b/test/spec/ol/geom/multilinestring.test.js index a63f6fa64f..e5fbe9ee62 100644 --- a/test/spec/ol/geom/multilinestring.test.js +++ b/test/spec/ol/geom/multilinestring.test.js @@ -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(); }); diff --git a/test/spec/ol/geom/multipoint.test.js b/test/spec/ol/geom/multipoint.test.js index c1b1f7098f..dae7d1fb21 100644 --- a/test/spec/ol/geom/multipoint.test.js +++ b/test/spec/ol/geom/multipoint.test.js @@ -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(); }); diff --git a/test/spec/ol/geom/multipolygon.test.js b/test/spec/ol/geom/multipolygon.test.js index 66acc83f1a..5c3b76ccf5 100644 --- a/test/spec/ol/geom/multipolygon.test.js +++ b/test/spec/ol/geom/multipolygon.test.js @@ -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(); }); diff --git a/test/spec/ol/geom/point.test.js b/test/spec/ol/geom/point.test.js index 1b00029a7e..4320c25499 100644 --- a/test/spec/ol/geom/point.test.js +++ b/test/spec/ol/geom/point.test.js @@ -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(); }); diff --git a/test/spec/ol/geom/polygon.test.js b/test/spec/ol/geom/polygon.test.js index ea18f84339..9973e15eaa 100644 --- a/test/spec/ol/geom/polygon.test.js +++ b/test/spec/ol/geom/polygon.test.js @@ -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(); }); diff --git a/test/spec/ol/geom/sharedvertices.test.js b/test/spec/ol/geom/sharedvertices.test.js index 66b7d8c48f..0e9c3fc29d 100644 --- a/test/spec/ol/geom/sharedvertices.test.js +++ b/test/spec/ol/geom/sharedvertices.test.js @@ -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); }); });