Fixing the extend method to work on IE.

In IE, events don't have a `hasOwnProperty` method.  Instead of trusting that the source objects have this method, we call the same on the Object prototype.  If we want to be safer about the `hasOwnProperty` calling done in e3cc96dbfb, we could create an `OpenLayers.Object.has` method that also used the Object prototype.
This commit is contained in:
tschaub
2012-03-02 16:52:11 -07:00
parent 9b2e46d9c5
commit 71276b5323
2 changed files with 26 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ OpenLayers.Util.extend = function(destination, source) {
destination = destination || {};
if (source) {
for (var property in source) {
if (source.hasOwnProperty(property)) {
if (Object.prototype.hasOwnProperty.call(source, property)) {
var value = source[property];
if (value !== undefined) {
destination[property] = value;