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

@@ -258,7 +258,9 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
activate: function () {
if (!this.active) {
for(var i in this.handlers) {
this.handlers[i].activate();
if (this.handlers.hasOwnProperty(i)) {
this.handlers[i].activate();
}
}
}
return OpenLayers.Control.prototype.activate.apply(
@@ -276,7 +278,9 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
deactivate: function () {
if (this.active) {
for(var i in this.handlers) {
this.handlers[i].deactivate();
if (this.handlers.hasOwnProperty(i)) {
this.handlers[i].deactivate();
}
}
}
return OpenLayers.Control.prototype.deactivate.apply(
@@ -560,7 +564,9 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
unselectAll: function() {
// we'll want an option to supress notification here
for(var fid in this.features) {
this.unselect(this.features[fid]);
if (this.features.hasOwnProperty(fid)) {
this.unselect(this.features[fid]);
}
}
},
@@ -573,7 +579,9 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
*/
setMap: function(map) {
for(var i in this.handlers) {
this.handlers[i].setMap(map);
if (this.handlers.hasOwnProperty(i)) {
this.handlers[i].setMap(map);
}
}
OpenLayers.Control.prototype.setMap.apply(this, arguments);
},