protect for in loops with hasOwnProperty
This commit is contained in:
@@ -332,12 +332,14 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
|
||||
// add in attributes
|
||||
for(var key in feature.attributes) {
|
||||
if(feature.attributes[key] !== undefined &&
|
||||
(!modified || !modified.attributes ||
|
||||
(modified.attributes && modified.attributes[key] !== undefined))) {
|
||||
this.writeNode(
|
||||
"Property", {name: key, value: feature.attributes[key]}, node
|
||||
);
|
||||
if (feature.attributes.hasOwnProperty(key)) {
|
||||
if(feature.attributes[key] !== undefined &&
|
||||
(!modified || !modified.attributes ||
|
||||
(modified.attributes && modified.attributes[key] !== undefined))) {
|
||||
this.writeNode(
|
||||
"Property", {name: key, value: feature.attributes[key]}, node
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,9 +412,11 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
var parts = [];
|
||||
var uri;
|
||||
for(var key in schemaLocations) {
|
||||
uri = this.namespaces[key];
|
||||
if(uri) {
|
||||
parts.push(uri + " " + schemaLocations[key]);
|
||||
if (schemaLocations.hasOwnProperty(key)) {
|
||||
uri = this.namespaces[key];
|
||||
if(uri) {
|
||||
parts.push(uri + " " + schemaLocations[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
var value = parts.join(" ") || undefined;
|
||||
|
||||
Reference in New Issue
Block a user