protect for in loops with hasOwnProperty
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user