r8455 introduced good changes to Class.js that gave us useful instanceof results. This change also made is so that people using the Class function to extend from non-OL constructors were unwittingly modifying their prototypes (by giving them an initialize property whose value was undefined). By ensuring that the parent prototype has an initialize property already, we don't add anything unexpected. r=crschmidt (closes #1987)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9051 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-03-15 01:31:11 +00:00
parent 8df8106a51
commit 49d6463f4e
4 changed files with 28 additions and 11 deletions

View File

@@ -558,6 +558,12 @@ OpenLayers.Format.GML = OpenLayers.Class(OpenLayers.Format.XML, {
this.regExes.trimSpace, "");
attributes[name] = value;
}
} else {
// If child has no childNodes (grandchildren),
// set an attribute with null value.
// e.g. <prefix:fieldname/> becomes
// {fieldname: null}
attributes[child.nodeName.split(":").pop()] = null;
}
}
}