protect for in loops with hasOwnProperty

This commit is contained in:
Bart van den Eijnden
2012-02-29 18:43:55 +01:00
parent d7a3ecac08
commit e3cc96dbfb
31 changed files with 385 additions and 266 deletions

View File

@@ -168,11 +168,16 @@ OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
* Take care of things that are not handled in superclass.
*/
destroy: function() {
for (var key in this.layerCache) {
delete this.layerCache[key];
var key;
for (key in this.layerCache) {
if (this.layerCache.hasOwnProperty(key)) {
delete this.layerCache[key];
}
}
for (var key in this.wfsCache) {
delete this.wfsCache[key];
for (key in this.wfsCache) {
if (this.wfsCache.hasOwnProperty(key)) {
delete this.wfsCache[key];
}
}
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},