Avoiding infinite recursion when getting bounds of geometry collections. r=ahocevar (closes #2967)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10953 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2010-12-07 23:37:56 +00:00
parent 92493cc12b
commit 43dd65d357
2 changed files with 28 additions and 4 deletions
+17
View File
@@ -392,6 +392,23 @@
coll.destroy();
}
function test_avoid_infinite_recursion(t) {
t.plan(1);
var g = new OpenLayers.Geometry.Polygon([
new OpenLayers.Geometry.LinearRing(),
new OpenLayers.Geometry.LinearRing()
]);
var bounds;
try {
bounds = g.getBounds();
t.eq(bounds, null, "Polygon with empty linear ring has null bounds");
} catch (err) {
t.fail("Failed to get bounds of polygon with empty linear ring: " + err.message);
}
}
function test_Collection_destroy(t) {
t.plan( 3 );