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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user