Revert "protect for in loops with hasOwnProperty"

This reverts commit e3cc96dbfb.
This commit is contained in:
Éric Lemoine
2012-03-03 22:35:39 +01:00
parent 161b54b6f1
commit 9a116b21b9
31 changed files with 267 additions and 386 deletions
+6 -10
View File
@@ -89,9 +89,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
this.namespaces = OpenLayers.Util.extend({}, this.namespaces);
this.namespaceAlias = {};
for(var alias in this.namespaces) {
if (this.namespaces.hasOwnProperty(alias)) {
this.namespaceAlias[this.namespaces[alias]] = alias;
}
this.namespaceAlias[this.namespaces[alias]] = alias;
}
},
@@ -560,13 +558,11 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
setAttributes: function(node, obj) {
var value, uri;
for(var name in obj) {
if (obj.hasOwnProperty(name)) {
if(obj[name] != null && obj[name].toString) {
value = obj[name].toString();
// check for qualified attribute name ("prefix:local")
uri = this.namespaces[name.substring(0, name.indexOf(":"))] || null;
this.setAttributeNS(node, uri, name, value);
}
if(obj[name] != null && obj[name].toString) {
value = obj[name].toString();
// check for qualified attribute name ("prefix:local")
uri = this.namespaces[name.substring(0, name.indexOf(":"))] || null;
this.setAttributeNS(node, uri, name, value);
}
}
},